Forcing Encrypted Connections in SQL Server Using Certificates

In the previous post, we looked at how to verify what protocol and encryption SQL Server is actually using at runtime.

That answers the question:

What is happening on the wire right now?

This post answers a different one:

How do I make sure every TCP connection is encrypted, every time?

Forcing encryption in SQL Server is not about toggling a security checkbox. It is a server-wide behaviour change that relies entirely on certificate correctness and client trust. Done properly, it is stable and predictable. Done casually, it can break connectivity instantly.

This post shows what “Force Encryption” really does, what SQL Server expects from certificates, and how to validate the result safely.


What “Force Encryption” Actually Means

When Force Encryption is enabled:

  • SQL Server requires encryption for TCP connections
  • Encryption is no longer negotiated with the client
  • Clients must trust the certificate SQL Server presents
  • Unencrypted TCP connections are rejected

This is different from modern defaults, where encryption is requested by many clients but not strictly required by the server.

Important clarifications:

  • Shared Memory connections are unaffected
  • Named Pipes behaviour depends on client support
  • This setting applies instance-wide, not per database

Force Encryption changes who is in control. The server enforces encryption, not the client.


Why Clients Suddenly Fail After Enabling It

Most “Force Encryption broke everything” incidents are certificate issues, not SQL Server bugs.

When Force Encryption is enabled, SQL Server must present a certificate that the client both accepts and trusts. If that does not happen, the connection fails before authentication.

Common causes include:

  • Self-signed certificates not trusted by clients
  • Certificate CN or SAN not matching the server name
  • Applications connecting via IP address instead of hostname
  • Older drivers that cannot validate modern TLS chains

If encryption was previously negotiated, these issues may have existed silently for years.


Certificate Requirements SQL Server Actually Enforces

SQL Server will only use certificates that meet all of the following requirements:

  • Installed in Local Computer → Personal store
  • Contains a private key
  • Includes Server Authentication in Enhanced Key Usage
  • Matches the SQL Server hostname (CN or SAN)

Wildcard certificates are valid if they correctly match the server name.

Certificates that look correct but fail one of these checks will be ignored.

SQL Server does not prompt you when it ignores a certificate.
It simply does not use it.

Microsoft reference:
https://learn.microsoft.com/en-us/sql/database-engine/configure-windows/configure-sql-server-encryption


How SQL Server Chooses a Certificate

SQL Server selects a certificate automatically at startup.

The rules are simple but unforgiving:

  • If exactly one valid certificate matches, it is used
  • If multiple certificates match, selection is undefined
  • If no valid certificate exists, encryption cannot be enforced

This is why environments with leftover or duplicated certificates often fail when Force Encryption is enabled.

Certificate hygiene matters.


Enabling Force Encryption (Server Side)

Force Encryption is configured at the SQL Server instance level.

High-level steps:

  • Open SQL Server Configuration Manager
  • Navigate to SQL Server Network Configuration
  • Open TCP/IP properties
  • Set Force Encryption = Yes
  • Restart the SQL Server service

A restart is required. There is no in-place toggle.

This is the point of no return. If certificates or trust are wrong, clients will fail immediately after restart.


📸 Image placeholder 1

Filename:
sql-server-force-encryption-tcp-enabled.png

Alt text:
SQL Server TCP protocol settings showing Force Encryption enabled

Description:
SQL Server Configuration Manager showing Force Encryption set to Yes for TCP/IP.


What Breaks First (and Why)

After enabling Force Encryption, these failures are common:

  • Applications using IP addresses instead of DNS names
  • Older ODBC or JDBC drivers
  • Clients without the issuing CA in their trust store
  • Availability Group replicas with mismatched certificates

These are not SQL Server failures. They are trust failures being exposed.

This is why Force Encryption should never be enabled without first verifying live connection behaviour.


Verifying Encryption After Enabling It

Do not rely on assumptions. Verify.

The same DMV used earlier confirms enforcement:

-- Show protocol and encryption for the current session
SELECT
    protocol_type,
    encrypt_option,
    auth_scheme
FROM sys.dm_exec_connections
WHERE session_id = @@SPID;

For forced encryption over TCP, encrypt_option must be TRUE.

To validate across all connections:

-- Show encryption usage across all active connections
SELECT
    protocol_type,
    encrypt_option,
    COUNT(*) AS connection_count
FROM sys.dm_exec_connections
GROUP BY protocol_type, encrypt_option;

This confirms reality, not configuration intent.

For a deeper walkthrough, see:
Check SQL Server Connection Encryption and Protocol


📸 Image placeholder 2

Filename:
sql-server-forced-encryption-dmv-results.png

Alt text:
SQL Server DMV results showing encrypted TCP connections

Description:
DMV output confirming TCP connections are encrypted after Force Encryption is enabled.


Relationship to SSMS Certificate Errors

Newer versions of SSMS request encryption by default. When Force Encryption is enabled, SSMS must fully trust the server certificate.

If it does not, you may see certificate chain errors.

That scenario is covered here:
SSMS Certificate Chain Not Trusted Error (Trust Server Certificate Fix)

Force Encryption removes the option to bypass trust issues.


When Force Encryption Makes Sense

Force Encryption is appropriate when:

  • SQL Server is accessed over untrusted networks
  • Regulatory or compliance requirements apply
  • You want guaranteed encryption consistency
  • You control certificate lifecycle centrally

It is not required for every internal instance.

Encryption should be deliberate, not habitual.


What This Post Does Not Cover

This post does not attempt to:

  • Walk through certificate creation step by step
  • Cover client-side overrides
  • Design encryption for Availability Groups in depth

Those deserve focused treatment and will be covered separately.


Final Notes

Force Encryption is not about being “more secure”.
It is about removing ambiguity.

Once enabled, SQL Server will only accept encrypted TCP connections using a certificate the client trusts. That clarity is powerful, but unforgiving.

Verify first. Enforce second. Validate always.


Tags

Encryption
SQL Server Security
SQL Server Networking
Certificates
DBA Operations
TLS

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *