SSL certificate error: what it means and how to fix it
An SSL certificate error means the browser or tool could not accept the certificate the website sent. Visitors can try the general browser and network checks below. Site owners most often need to serve the full certificate chain or renew an expired certificate. The server-side steps here are for nginx and Certbot.
On this page
What it means
"SSL certificate error" is not one single error. It is the general name for any case where a browser, curl, Java, Node or another client looks at the certificate a website presents and refuses it. You may see Chrome's "Your connection is not private" page, or unable to verify the first certificate in a terminal.
A client generally accepts a certificate only when it chains to a trusted root through the intermediate certificates the server sends, the current date is inside its validity period, and it has not been revoked.
The fix depends on which side you are on. A visitor can run through the general checks below. A site owner usually has a server-side problem: an incomplete chain or an expired certificate. The server-side steps in this article are written for nginx and Certbot. For a broader walkthrough of diagnosing TLS problems, see SSL error: how to find the cause and fix it. On a Fire TV, see SSL certificate error on Fire TV Stick.
Symptoms and causes
You are likely dealing with this problem if:
- Chrome shows "Your connection is not private".
- curl or Node refuses the connection with a certificate verification error.
- The site opens fine in desktop Chrome but fails in curl, Java, Android or an API client.
The usual causes, most common first:
- The server does not send the intermediate certificate
- The chain is incomplete. A typical case is nginx pointing
ssl_certificateat a file with only the site certificate. Browsers that have cached the intermediate may not complain, which hides the problem. - The certificate has expired
- Often an automatic renewal failed, for example because port 80 was blocked, the certificate was issued with Certbot's
--manualoption, or Certbot could not configure the server. - An old client that lacks newer roots
- Platforms older than the Let's Encrypt root requirements can fail to validate its chain, even when the server is correct. The compatibility page lists the minimum versions.
- A problem on the visitor's side
- Chrome's help lists browser state, extensions, firewall or antivirus software and public Wi-Fi sign-in pages as general causes of connection errors. It does not single out certificates, so treat these as things to rule out.
How to fix it
Work through these in order. They start with the quickest, safest checks and move to deeper repairs; stop as soon as the problem is gone.
1.Check your browser and connection (visitors)
Chrome's help for connection errors suggests these checks. They rule out a problem on your device or network before you blame the website.
- Reload the page and check the address for typos. On public Wi-Fi, finish the network's sign-in page first.
- Update and restart the browser, then try the page in an Incognito window. If it works there, disable extensions one by one to find the culprit.
- Check whether antivirus or a firewall is interfering. If you temporarily turn off a third-party antivirus to test, turn it back on straight afterwards.
- Clear browsing data. As a last resort, reset Chrome settings.
- If the error appears only for one site you do not own, do not click through the warning. Wait for the owner to fix it.
2.Serve the full certificate chain (nginx owners)
If only entry 0 appears in the certificate chain, the server is not sending the intermediates, and clients other than your own browser may fail.
Before you start: Back up the current certificate and configuration files before editing. In the combined file the site certificate must come first, otherwise nginx fails to start with a "key values mismatch" error. These steps cover nginx only; for Apache or IIS, follow your server vendor's documentation.
- Check what the server sends. If the Certificate chain section lists only one entry (0), the intermediate is missing.
openssl s_client -connect www.example.com:443 - For a certificate you received from a CA, build a file with your certificate first, then the CA bundle.
cat www.example.com.crt bundle.crt > www.example.com.chained.crt - Point nginx at the combined file.
ssl_certificate www.example.com.chained.crt; ssl_certificate_key www.example.com.key; - Test the configuration and reload nginx.
nginx -t && nginx -s reload
3.Renew an expired certificate (site owners)
An expired certificate is rejected by every client. Fixing the renewal fixes the error for everyone.
- Run a renewal and read the error output.
certbot renew - Make sure port 80 is reachable from the internet if you validate over HTTP.
- Remember that certificates issued with
--manualdo not renew automatically, while certificates using a DNS plugin do. Reissue manual ones with a method that can renew. - If a challenge keeps failing, test your domain with Let's Debug, which the Certbot FAQ points to.
4.Check for an old client
Older systems may not trust newer Let's Encrypt roots, so a correct server can still fail for them.
- Compare the affected device against the Let's Encrypt compatibility list and note the minimum versions it gives for each root.
- Update the operating system or runtime on the affected device if it is older than those versions.
Check that it worked
- The site loads over HTTPS without a warning page in a fresh browser window.
openssl s_client -connect host:443lists the site certificate plus its intermediate(s), not only entry 0.- curl or your API client connects without a certificate error.
If it still fails
- Note the exact error message and whether it affects all devices or only one. A single device points to the browser, network or client; all devices point to the server.
- Ask your hosting provider or certificate authority for support, giving them the domain and the output of the openssl command.
- See the related guide SSL error: how to find the cause and fix it.
Questions
Why does the site work in my browser but fail in curl or Java?
nginx's documentation says browsers that have cached the intermediate certificate may not complain about a missing one. Other clients can, so this pattern points to an incomplete chain on the server.
Sources
- Configuring HTTPS servers (certificate chains)Official · nginx.org
- Certificate CompatibilityOfficial · Let's Encrypt (ISRG)
- Certbot FAQOfficial · EFF Certbot
- Fix connection or loading errors in ChromeOfficial · Google