Support Library
TLS Certificate Chain Troubleshooting
A certificate error stops a visitor before your site loads, and it often appears in one client but not another. Most errors come from the chain of certificates the server sends, the names on the certificate, or the dates. This guide explains each piece and how to tell a TLS problem from a DNS one.
The short answer
A server proves its identity with a leaf certificate for its name, plus the intermediate certificates that link it to a root the client already trusts. The client checks every signature in that chain, that the leaf names the host it asked for, and that nothing has expired. The most common fault is a server that sends only the leaf: browsers often repair the gap on their own, but curl, API clients, mobile apps and mail servers fail with "unable to get local issuer certificate". Fix it by installing the full chain (leaf plus intermediates) on every server and address that answers for the name, then test with openssl s_client.
Leaf, intermediate and root
| Certificate | Issued to | Where it comes from |
|---|---|---|
| Leaf (end-entity) | Your names, such as example.com and www.example.com | Sent by your server, issued by an intermediate |
| Intermediate | The CA's issuing certificate | Sent by your server, after the leaf. There may be more than one. |
| Root | The CA itself (self-signed) | Already in the client's trust store. The server does not need to send it. |
The client builds a path from the leaf, through the intermediates, to a root it trusts, and checks:
- each certificate's signature against the next one up;
- that today's date is within every certificate's validity period;
- that the leaf's Subject Alternative Name list contains the host name it asked for (the old Common Name field is ignored by modern clients);
- that the leaf is allowed for server authentication, and, where the client checks, that it has not been revoked.
Common chain problems
| Problem | Typical error | Fix |
|---|---|---|
| Missing intermediate | "unable to get local issuer certificate" or "unable to verify the first certificate"; works in some browsers only | Install the full chain file the CA provides (often called fullchain.pem) |
| Wrong or old intermediate | The same errors, or failures only on older devices | Use the chain the CA currently issues with your certificate, not one saved years ago |
| Name not on the certificate | "hostname mismatch" or ERR_CERT_COMMON_NAME_INVALID | Reissue with every name visitors use, such as both the apex and www. A wildcard covers one level only: *.example.com covers www.example.com but not example.com or a.b.example.com. |
| Expired leaf | "certificate has expired" | Renew and reload the server; automate renewal |
| Wrong certificate for the name | A certificate for another site, or a default one | The server did not match the SNI name to the right site; add the name to the site's configuration |
| Self-signed or private CA | "self-signed certificate in certificate chain" | Use a publicly trusted certificate for public sites; install the private root on managed clients only |
| Client clock wrong | "certificate is not yet valid" on one device | Fix the device's time |
| Corporate TLS inspection | The issuer is a company proxy, not a public CA | Expected on that network; test from outside it |
SNI and servers that share an address
Many sites share one IP address. The client sends the name it wants in the TLS handshake (Server Name Indication, SNI), and the server picks the matching certificate. If the name is not configured, the server sends its default certificate, which is the wrong one. Always pass the name when testing (-servername in openssl), or you test the default site instead of yours.
Behind a load balancer or CDN, every server and every address must be fixed, including IPv6. A chain fixed on one of four servers fails for a quarter of visitors.
Checking the chain with openssl and curl
| Command | What it shows |
|---|---|
| openssl s_client -connect www.example.com:443 -servername www.example.com -showcerts </dev/null | Every certificate the server sends, in order, and a final Verify return code. 0 means the chain is good. |
| openssl s_client -connect www.example.com:443 -servername www.example.com -verify_hostname www.example.com </dev/null | Also checks the name; code 62 means hostname mismatch |
| openssl s_client -connect www.example.com:443 -servername www.example.com </dev/null 2>/dev/null | openssl x509 -noout -subject -issuer -dates -ext subjectAltName | The leaf's names, issuer and validity dates (OpenSSL 3) |
| openssl s_client -connect 192.0.2.10:443 -servername www.example.com </dev/null | One specific server, bypassing DNS |
| openssl verify -untrusted chain.pem leaf.pem | Whether a chain file you are about to install is correct |
| curl -vI https://www.example.com/ | The handshake as a non-browser client sees it, which does not repair missing intermediates |
| curl.exe -vI https://www.example.com/ | The same from Windows PowerShell |
| Verify return code | Meaning |
|---|---|
| 0 | OK |
| 10 | Certificate has expired |
| 18 or 19 | Self-signed certificate, or a self-signed root in the chain that the client does not trust |
| 20 or 21 | Unable to get the issuer, or to verify the first certificate: usually a missing intermediate |
| 62 | Hostname mismatch (with -verify_hostname) |
Fixing it and confirming the fix
- Get the right chain from your CA or ACME client. Certbot and most ACME clients write a fullchain.pem.
- Point the server at it. On nginx, ssl_certificate takes the full chain. On Apache 2.4.8 and later, SSLCertificateFile takes the leaf followed by the intermediates. On IIS and Windows, import the intermediate into the Intermediate Certification Authorities store. On a CDN or load balancer, upload the chain there.
- Reload the service so it reads the new files.
- Test every address with the openssl commands above, and once more from outside your network, for example with an online TLS test.
- Automate renewal and alert on expiry well ahead of time.
TLS problem or DNS problem?
| What you see | Layer |
|---|---|
| "Server not found", NXDOMAIN, SERVFAIL or a lookup timeout | DNS: the browser never reached a server. See why a domain is not resolving. |
| A certificate warning that names another site or a hosting provider | Usually DNS pointing at the wrong server (an old address, or a CDN that does not know your name yet), which then sends its own certificate |
| Expired, untrusted issuer or missing intermediate | TLS, on the server that answered |
| Works on one network, fails on another | Either: compare the IP each network resolves, then the certificate each IP sends |
So check DNS first: confirm the name resolves to the server you expect (dig +short www.example.com), then check the certificate that server sends.
How DNS Panopticon helps
Security Posture checks whether a domain's homepage loads over HTTPS and redirects plain http to it, and its TLS and Certificates card reads CAA and DANE records. Website Recon shows the domain's current certificate from Certificate Transparency logs, with its issuer and dates. The TLS Chain Checker reads the chain your server actually sends during the handshake and explains each problem, and the TLS Configuration Checker also tests its protocol versions and cipher suites (see TLS protocols and cipher suites).
FAQ
Why does my site work in Chrome but fail in curl or an app?
Most likely the server is missing an intermediate certificate. Some browsers fetch or remember missing intermediates on their own; curl, many API clients and apps do not. Install the full chain.
Should the server send the root certificate?
It does not need to. Clients already have the root in their trust store. Sending it does no harm beyond a few extra bytes.
Does a wildcard certificate cover the bare domain?
No. A certificate for *.example.com covers names one level below, such as www.example.com, but not example.com itself. Add example.com as a separate name on the same certificate.
Can DNS cause a certificate error?
Yes, indirectly. If the name resolves to the wrong server, that server sends its own certificate, which does not match your name. Check where the name resolves before changing certificates.
Why are check times shown in UTC?
The TLS Chain Checker shows when it checked the server in Coordinated Universal Time (UTC), the same clock certificates use for their validity dates, so a colleague looking at the same result sees the same time. Hover over the time to see it in your own time zone.
Sources and further reading
- RFC 5280: Internet X.509 Public Key Infrastructure Certificate and CRL Profile
- RFC 6125: Representation and Verification of Domain-Based Application Service Identity
- RFC 8446: The Transport Layer Security (TLS) Protocol Version 1.3
- RFC 6066: TLS extensions (Server Name Indication)
- OpenSSL: s_client manual page
- OpenSSL: verify manual page (error codes)
- nginx: configuring HTTPS servers (certificate chains)
- Let's Encrypt: chains of trust