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.

Applies to:Web browsers and TLS clients (Chrome, curl, Java, Node)nginx and Certbot (server-side steps only)
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_certificate at 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 --manual option, 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)

Easy

Chrome's help for connection errors suggests these checks. They rule out a problem on your device or network before you blame the website.

  1. Reload the page and check the address for typos. On public Wi-Fi, finish the network's sign-in page first.
  2. 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.
  3. 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.
  4. Clear browsing data. As a last resort, reset Chrome settings.
  5. 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)

ModerateChanges settings

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.

  1. Check what the server sends. If the Certificate chain section lists only one entry (0), the intermediate is missing.
    Terminal
    openssl s_client -connect www.example.com:443
  2. For a certificate you received from a CA, build a file with your certificate first, then the CA bundle.
    Terminal
    cat www.example.com.crt bundle.crt > www.example.com.chained.crt
  3. Point nginx at the combined file.
    nginx.conf
    ssl_certificate     www.example.com.chained.crt;
    ssl_certificate_key www.example.com.key;
  4. Test the configuration and reload nginx.
    Terminalneeds sudo / root
    nginx -t && nginx -s reload

3.Renew an expired certificate (site owners)

Moderate

An expired certificate is rejected by every client. Fixing the renewal fixes the error for everyone.

  1. Run a renewal and read the error output.
    Terminalneeds sudo / root
    certbot renew
  2. Make sure port 80 is reachable from the internet if you validate over HTTP.
  3. Remember that certificates issued with --manual do not renew automatically, while certificates using a DNS plugin do. Reissue manual ones with a method that can renew.
  4. If a challenge keeps failing, test your domain with Let's Debug, which the Certbot FAQ points to.

4.Check for an old client

Advanced

Older systems may not trust newer Let's Encrypt roots, so a correct server can still fail for them.

  1. Compare the affected device against the Let's Encrypt compatibility list and note the minimum versions it gives for each root.
  2. 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:443 lists 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

  1. Configuring HTTPS servers (certificate chains)Official · nginx.org
  2. Certificate CompatibilityOfficial · Let's Encrypt (ISRG)
  3. Certbot FAQOfficial · EFF Certbot
  4. Fix connection or loading errors in ChromeOfficial · Google