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.
The certificate chain was issued by an authority that is not trusted 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
- Install a trusted certificate on SQL Server
- For development: TrustServerCertificate=True
- Or Encrypt=False on trusted networks
Detailed fix by platform
.NET
Server=db;Database=App;User Id=app;Password=…;Encrypt=True;TrustServerCertificate=True;
How to diagnose
- Driver — Version (encrypt default)?
- 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:
Similar errors
Most viewed in SQL
Other ways to find it
Where this error sits
Origin: Data. Errors that are often confused with or caused by this one (click to open):
🧠 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.
Report a correction or suggest an improvement
Last updated 12 Oct 2026