Fix an SSL certificate that browsers don't trust
NET::ERR_
Why the browser doesn't trust the certificate
A self-signed certificate
A certificate the server signed for itself proves nothing to a browser. Servers often create one during setup, and it stays until someone replaces it with one from a public authority.
A certificate from an internal authority
A company's own authority is trusted only on devices set up to trust it. Your public visitors' browsers don't know it.
A missing intermediate certificate
Public authorities sign your certificate with an intermediate certificate, and your server should send that intermediate along with yours. Some browsers fill in a missing one and others don't, so the error can appear in one browser or app and not another.
Something on the visitor's side
Antivirus software or a network that inspects HTTPS can swap in its own certificate. If only one device or network shows the error, test from another before you change your server.
Chromium's error list names a self-signed certificate, an authority the browser doesn't know and an attacker as causes; see net_
See which certificates your server sends
# Count the certificates yoursite.com sends
echo | openssl s_client -connect yoursite.com:443 -servername yoursite.com -showcerts 2>/dev/null \
| grep -c "BEGIN CERTIFICATE"
# Show whether openssl could verify the chain
echo | openssl s_client -connect yoursite.com:443 -servername yoursite.com 2>/dev/null \
| grep -E "Verify return code|no peer certificate"
Read what openssl reports
A count of 0, or a
no peer certificate availableline from the second command, means the handshake failed before any certificate arrived, so ignore the return code, since openssl prints0 (ok)even then. A count of 1 means the server sends only its own certificate, which usually means the intermediate is missing.Verify return code: 0 (ok)means openssl traced the chain to an authority it trusts.Code 18 or 19 points to a self-signed certificate, and code 20 or 21 to a missing intermediate or an authority openssl doesn't know. OpenSSL's verification error list explains every code.
How to fix an untrusted SSL certificate
- Install a certificate from a public authorityReplace a self-signed or internal certificate with one from a public certificate authority. Let's Encrypt issues them for free, and most hosts and CDNs set one up for you once your domain points at them.
- Send the full chainPoint your server at the full chain file your authority provides, which holds your certificate followed by the intermediate, rather than at your certificate alone.
- Reload and test againReload whatever handles HTTPS, then run both openssl commands again. You want at least two certificates and a return code of 0.
- Test from another network if only some visitors see itIf your server checks out but a visitor still sees the error, their antivirus software or network is replacing the certificate, and the fix is on their side.
Frequently asked questions
Is a self-signed certificate ever fine?
For a server only your own devices use, set up to trust it, yes. For a public website, no: every visitor's browser warns, because no authority vouches for the certificate.
Why does my site work in Chrome but fail in another app?
Some browsers fill in a missing intermediate certificate on their own, and many apps and command-line tools don't. If the count above is 1, send the full chain and the difference goes away.
Do I have to pay for a trusted SSL certificate?
No. Let's Encrypt is a free certificate authority that browsers trust, and many hosts use it to set up HTTPS for you.
Watch your certificate and HTTPS setup
- Domain healthFix the setup mistakes that make browsers warn people away from your site.
- Expired SSL certificateFind out whether the certificate expired or a clock is wrong, then renew it and serve the new one.
- SSL certificate name mismatchFind the address your certificate leaves out, then get one that covers it.
- HSTSUnderstand how browsers remember HTTPS before extending that rule to every subdomain.