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.
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
- 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 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.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 2 Oct 2026