-3

When trying to connect to SQL Server, I get this 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 is issued by a non-trusted certificate authority.) (Framework Microsoft SqlClient Data Provider)

I tried reinstalling SQL Server and Management Studio, but nothing helped.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Chārry
  • 1
  • 2
  • The error message is self explanatory. What's your question? You need to either setup your client to trust the certificate or change the certificate used by the server. – Gaël J Sep 02 '23 at 11:56
  • Are you using `Microsoft.Data.SqlClient`? Since version 4.0 it has had a breaking change: _Encrypt = true, by default_. This matters because on-prem SQL Server instances use a self-signed certificate by default and self-signed certificates are not trusted because they're not CA issued. Ref: [Released: General Availability of Microsoft.Data.SqlClient 4.0](https://techcommunity.microsoft.com/t5/sql-server-blog/released-general-availability-of-microsoft-data-sqlclient-4-0/ba-p/2983346) – AlwaysLearning Sep 02 '23 at 11:57
  • If you're actually getting this from SSMS itself: have you tried clicking on the Connection Properties tab and ticking _Trust server certificate_? – AlwaysLearning Sep 02 '23 at 12:00

0 Answers0