The certificate chain was issued by an authority that is not trusted sql server

A connection was successfully established with the server, but then an error occurred during the login process. (provider: SSL Provider, error: 0 - The certificate chain was issued by an authority that is not trusted.) (Microsoft SQL Server)

Error

A connection was successfully established with the server, but then an error occurred during the login process. (provider: SSL Provider, error: 0 – The certificate chain was issued by an authority that is not trusted.) (Microsoft SQL Server). The certificate chain was issued by an authority that is not trusted.

Cause

SQL Server Management Studio is able to establish the connection to SQL Server however the server certificate is not trusted.

Solution

Follow below simple steps to solve the issue.

  1. Open SSMS and Click Connect Database Engine.
  2. Enter SQL Server instance name and provide SQL server authentication username and password.
  3. Click on the ‘Options <<‘ button and check the Trust server certificate checkbox.
  4. Click Connect and your connection should now work.

If you are facing this issue in SQL server connection using a connection string, add ‘TrustServerCertificate=True’ as a parameter to your connection string.

Kunal Rathi

Been working on Microsoft data platforms for more than a decade. Helping customers transform their data into insights, Cloud & DevOps enthusiast.