certificate chain not trusted SQL Origin: Data OSI layer 6 · Presentation Last updated 12 Oct 2026

SQL Server: The certificate chain was issued by an authority that is not trusted.

The client requires an encrypted connection and doesn’t trust SQL Server’s (often self-signed) certificate.

Exact message you may see The certificate chain was issued by an authority that is not trusted
Seen on: SQL

Meaning

Microsoft.Data.SqlClient 4.0+ and ODBC Driver 18 default to Encrypt=True. Servers with self-signed certificates fail validation.

Common causes

  • Encrypt=True by default with a self-signed server certificate
  • Certificate not issued for the server name

⚡ Quick fix

  1. Install a trusted certificate on SQL Server
  2. For development: TrustServerCertificate=True
  3. Or Encrypt=False on trusted networks

Detailed fix by platform

.NET

  1. Server=db;Database=App;User Id=app;Password=…;Encrypt=True;TrustServerCertificate=True;

How to diagnose

  1. Driver — Version (encrypt default)?
  2. Certificate — Trusted CA?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Data. Errors that are often confused with or caused by this one (click to open):

10054 — SQL Server error 10054: An existing connection was forcibly closed by the remote host (SQL)100541013 — Cloudflare Error 1013: HTTP hostname and TLS SNI hostname mismatch (Cloudflare)1013102 — SQL Server: Incorrect syntax near 'x'. (Msg 102) (SQL)10218456 — SQL Server: Login failed for user 'x'. (Error 18456) (SQL)18456207 — SQL Server: Invalid column name 'x'. (Msg 207) (SQL)207208 — SQL Server: Invalid object name 'x'. (Msg 208) (SQL)208245 — SQL Server: Conversion failed when converting the varchar value 'x' to data type int. (Msg 245) (SQL)2452627 — SQL Server: Violation of PRIMARY KEY constraint 'x'. Cannot insert duplicate key in object 'y'. (Msg 2627) (SQL)2627certifica…

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.