Technical Anshu
Tutorials Blog
🔐 SQL Server Fix

SQL Server Encryption and Certificate Error Fix in the Right Order

SQL Server says the connection was established and then fails during login with a certificate trust error. This is not a network problem and your data is not gone. It is a trust problem between the client and the server certificate, and it has one fast fix and one proper fix. Both are here, honestly graded.

✍️ Technical Anshu🔐 SQL Server • SSMS and apps
🎥 The complete one click fix for this exact error, shown step by step in this video

Your app or SSMS connected yesterday and refuses today, or a fresh install has never connected at all. The error text is long but its meaning is short: the client demanded an encrypted, identity-checked login, and the server's certificate could not pass the identity check. Work through the fixes in this order: understand the message, apply the one click client fix if your situation allows it, use the same switch in app connection strings, then finish the job properly on the server so nobody has to tick that box again.

Microsoft SQL Server Management Studio
Error connecting to the 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.)

The full error exactly as SSMS shows it, recreated with the real Microsoft wording. Read it carefully, it already tells you where the problem lives.
1

Understand What the Error Is Really Saying

Your network is fine and the server is running. The connection reached SQL Server, the server offered an encrypted channel, and your PC refused it because the certificate proving the server's identity is signed by nobody your PC trusts. By default SQL Server protects the login with a self-signed certificate it creates itself. A self-signed certificate encrypts the traffic, but it cannot prove the server is really your server, so strict clients reject it.

So the real problem is not connectivity. It is trust. Every honest fix is one of two things: make the client accept this particular server knowingly, or give the server a certificate that clients trust on their own. Both routes are in this guide, in the right order.

2

The One Click Fix in SSMS (Fast, Client Side)

This is the quick route shown in the video. It changes nothing on the server; it tells this one connection to accept the server's certificate without checking who signed it.

  1. In the SSMS Connect to Server window, click Options to open the extra tabs
  2. Open the Connection Properties tab
  3. Set Encryption to Mandatory (or leave it as offered) and tick Trust server certificate
  4. Click Connect. The login goes through immediately

Honest grading: traffic stays encrypted, but the identity check is skipped, so the client would also accept a fake server in between. On your own office LAN, for a server you control, this is the accepted day-to-day workaround. Over the internet or on a production server holding customer data, treat it as a temporary bridge only, and do Fix 4.

3

The Same Fix Inside an App Connection String

If an application fails instead of SSMS, the same switch lives in its connection string. The modern Microsoft driver spells it like this:

Connection string (Microsoft.Data.SqlClient)
Server=SQL01;Database=AppDB;User Id=appuser;Password=********;Encrypt=True;TrustServerCertificate=True
The two switches that mirror the SSMS checkbox. Encrypt turns the protected channel on, TrustServerCertificate skips the signing check.
4

The Proper Fix - Give the Server a Real Certificate

The permanent repair happens once, on the server, and then every client connects strictly with no checkbox and no warning:

  1. Get a certificate for the server's full DNS name (for example sql01.company.local) from your internal certificate authority or a public CA, with Server Authentication usage
  2. Import it into the Local Computer certificate store on the SQL Server machine
  3. Give the SQL Server service account Read permission on the certificate's private key
  4. Open SQL Server Configuration Manager, expand SQL Server Network Configuration, right-click Protocols for MSSQLSERVER, choose Properties, and select the certificate on the Certificate tab
  5. Restart the SQL Server service, then connect from a client using the server's DNS name with encryption on and Trust server certificate unticked

One detail decides success: clients must connect by the name written in the certificate. Connecting by IP address to a certificate issued for a DNS name fails the same check, for a different reason.

5

Prove the Connection Is Really Encrypted

Do not trust the absence of an error. Ask SQL Server itself. Run this while connected in SSMS:

SQL Server query window
SELECT session_id, encrypt_option, auth_scheme FROM sys.dm_exec_connections WHERE session_id = @@SPID; session_id encrypt_option auth_scheme ----------- --------------- ----------- 57 TRUE SQL
encrypt_option TRUE is the proof. If it says FALSE, you are connected but the traffic is not protected, whatever the dialog suggested.

Check this after every route above. The quick fix and the proper fix should both end at TRUE.

🔴 The honest warning: the one click fix (Trust server certificate) encrypts your traffic but stops checking who is at the other end. Fine on a LAN you control. On a production server or across the internet, it silently accepts an impostor server too - install a real certificate there instead.

🎥 Watch the One Click Fix in the Video

The video shows the one click route live - the exact checkbox, on the exact screen, in under a minute. Watch it once and the error will never scare you again.

▶️ Watch Full Video
❓ Frequently Asked Questions

Is my password or database damaged when this error appears?

No. The login never completes, so nothing is checked and nothing is changed. Your password, database and data are untouched; only the secure channel setup failed.

Why did this error appear suddenly when nothing changed on the server?

Usually the client changed, not the server. SSMS 20 and newer drivers encrypt by default and validate the certificate strictly, where older versions connected quietly. A separate case guide on this page covers that change in detail.

Will Trust server certificate make my connection unencrypted?

No. The traffic is still encrypted. What you give up is the identity check - the client no longer proves the server is genuine. That is why it is a LAN workaround, not a production practice.

This guide is based on the Technical Anshu SQL Server fix video • Stuck on a step? Ask in the video comments — you will get a reply 🙏