This issue typically occurs when a client application attempts to connect to a Microsoft SQL Server using an encrypted connection but cannot verify the identity of the server's certificate.
Before you begin
You will need:
A client application capable of connecting to a Microsoft SQL Server (such as SQL Server Management Studio or a custom application).
The connection details for the Microsoft SQL Server (IP address or hostname, port, and credentials).
Administrative access to the client machine to modify the trusted root certificate store.
Resolve the trust error by trusting the certificate
Depending on the application you are using, you can often resolve this by adjusting the connection settings to trust the certificate provided by the server.
For SQL Server Management Studio (SSMS)
Open SQL Server Management Studio.
In the Connect to Server dialog, enter your server credentials.
Click Options (or Options >>).
Select the Connection Properties tab.
Locate the Trust server certificate checkbox.
Check the box for Trust server certificate.
Click Connect.
For .NET Applications or Connection Strings
If you are using a custom application with a connection string, you can modify the connection string to bypass the certificate trust check.
Warning: Trusting a certificate without verification can expose your connection to man-in-the-middle attacks. Only use this method if you are on a secure, private network or have verified the server's identity.
Locate the connection string used by your application.
Add or modify the following parameters:
TrustServerCertificate=True;Encrypt=True;
Restart the application.
Resolve the trust error by installing the certificate
If you prefer to maintain high security without bypassing the trust check, you must install the server's certificate into the client's trusted store.
Obtain the public certificate (.cer or .crt file) from the Microsoft SQL Server.
On the client machine, press
Win + R, typecertlm.msc(for local machine) orcertmgr.msc(for current user), and press Enter.Navigate to Trusted Root Certification Authorities > Certificates.
Right-click in the folder and select All Tasks > Import.
Follow the Import Wizard to select the certificate file and complete the import.
Restart your client application and attempt the connection again.
Confirm the result
The client application successfully establishes a connection to the Microsoft SQL Server.
The "Certificate Trust" or "Certificate Chain" error no longer appears during the login process.
Troubleshooting Microsoft SQL Server Network or Instance-Specific Connection Error
If you still cannot connect after resolving the certificate issue, the problem may be related to network reachability.
Verify that the SQL Server's IP address or hostname is correct.
Ensure the SQL Server port (default is
1433) is open on the server's firewall and any network firewalls.Test the connection using a tool like
telnetorTest-NetConnectionto ensure the port is reachable from the client machine.
Limitations
This procedure does not resolve issues caused by incorrect IP addresses or incorrect port numbers.
If the server is using a self-signed certificate,
TrustServerCertificate=Truecan be used as a temporary workaround after verifying the server's identity. For production environments, use a properly configured certificate and validate the certificate chain whenever possible.If the certificate is expired or issued by an untrusted authority, the certificate must be replaced or the root CA must be installed as described in the "Install the certificate" section.
