Core component of SQL Server for storing, processing, and securing data
Yes. With MSOLEDBSQL 19, a connection can still be established with encryption when TrustServerCertificate=True is used, even if the server does not have a CA-signed certificate and the client does not trust the server certificate.
How it works depends on the encryption mode:
- If encryption is negotiated or required and
TrustServerCertificate=Trueis in effect, the connection can proceed without validating the server certificate. - In that case, the session can still be encrypted, but certificate chain trust and hostname validation are bypassed.
- This behavior is why the connection can succeed even when the certificate is self-signed or not present in the client trusted root store.
For MSOLEDBSQL 19 specifically:
-
TrustServerCertificatewas not removed in version 19. - Version 19 evaluates
TrustServerCertificatein all encrypted scenarios. - A key change from version 18 is this case: when the client sets
Encrypt=nobut the server forces encryption, version 18 ignoredTrust Server Certificate, while version 19 evaluates it. - Because of that change, version 19 clients using default settings can fail when the server forces encryption and uses an untrusted certificate, unless
Trust Server Certificateis updated or a trusted certificate is used.
The underlying behavior is not that SQL Server waives trust requirements on its own. The driver is what allows the connection by choosing to encrypt the channel while skipping certificate validation when TrustServerCertificate=True applies.
The certificate used is still the certificate presented by SQL Server during TLS negotiation. The difference is that, with TrustServerCertificate=True, the driver accepts that certificate without requiring it to chain to a trusted CA.
Why trusted certificates are still recommended:
- A valid CA-signed certificate provides certificate validation.
- The certificate must match the server FQDN when validation is enforced.
- The certificate must be trusted by the client system.
- This is the secure configuration and is required in stricter modes.
For example, when Encrypt=True or Encrypt=Mandatory and TrustServerCertificate=Yes is not used, the connection requires a valid CA-signed certificate, FQDN match, and trust on the client. When Encrypt=Strict, TrustServerCertificate is not supported; a valid trusted certificate is required.
So the recommendation to install a trusted certificate or import the server certificate exists because TrustServerCertificate=True is a compatibility/convenience setting that allows encrypted connectivity without certificate validation, whereas trusted certificates provide actual server identity validation and stronger security.
One more MSOLEDBSQL 19 detail: keyword format differs by interface:
- Provider connection strings:
TrustServerCertificate=yes; -
IDataInitializeconnection strings:Trust Server Certificate=yes;