The error occurs because the SQL Server is using a certificate that the client machine does not trust. To resolve this, either establish trust for the server’s certificate authority on the client or configure the client to trust the server certificate without validation.
Use one of these approaches:
- Install the server’s CA certificate on the client (recommended)
This makes the certificate chain trusted and fixes the error correctly.
- On the SQL Server machine, export the server certificate:
- Run
MMC (Microsoft Management Console).
- Add the Certificates snap-in for the Computer account.
- Expand Personal → Certificates.
- Right-click the SQL Server certificate → All Tasks → Export.
- In the Certificate Export Wizard:
- Choose No, do not export the private key.
- Choose DER encoded binary X.509 (.CER) or Base-64 encoded X.509 (.CER).
- Specify a file name (for example,
caCert.cer) and finish the export.
- On the client machine (where SSMS or the app runs), install the CA certificate into Trusted Root Certification Authorities:
- Run
MMC and add the Certificates snap-in for Computer account.
- Expand Certificates (Local Computer) → Trusted Root Certification Authorities.
- Right-click Certificates → All Tasks → Import.
- In the Certificate Import Wizard:
- Browse to the exported
caCert.cer file.
- Accept the default certificate store (Trusted Root Certification Authorities).
- Complete the wizard.
- Retry the connection from SSMS or the client application. The certificate chain should now be trusted and the encrypted connection should succeed.
- Trust the server certificate from the client (less secure)
If using a self-signed certificate or cannot install the CA root, configure the client to trust the server certificate without validating the chain:
- In SSMS: In Connect to Server → Options → Connection Properties, select Trust server certificate and then connect.
- In application connection strings (for SqlClient or similar): set
TrustServerCertificate=true.
This bypasses CA validation and is less secure; it should not be used in production or on internet-facing servers.
- If encryption is not required
If encrypted connections are not needed and the current configuration is accidental:
- Disable encryption in the client connection settings.
- On SQL Server, disable server-side encryption using SQL Server Configuration Manager (turn off Force Encryption).
Note: Disabling encryption or blindly trusting certificates reduces security and should be evaluated carefully.
References: