The browser won't open the page and shows NET::ERR_CERT_AUTHORITY_INVALID, but when you hit the same domain with curl, no error comes back. This contradiction almost always means one thing: the certificate chain on the server is incomplete, and the client that sources intermediate certificates from elsewhere doesn't see the gap. If you're looking for the official definition and exact value rather than a step-by-step tutorial, read on.
What exactly makes up a certificate chain
A TLS certificate means nothing on its own. Every leaf certificate is signed by a CA, and that CA itself may be signed by a higher CA. The chain is the ordered sequence of these signatures that leads to a root certificate. The root sits in the operating system or browser trust store, which is why it doesn't need to be served on the server.
The standard structure is three levels:
- Leaf certificate for your domain, with
subjectequal to the domain andissuerequal to the intermediate CA. - Intermediate certificate that signed the leaf. This is what goes missing in most failures.
- Root certificate that signed the intermediate and resides in the client trust store.
In older certificates you may have two intermediates back to back. You determine the number of levels from the issuer field of each certificate, not from memory.
Why curl passes without error but the browser gets stuck
This behavioral difference is the root of most confusion. Different clients have different policies for completing the chain.
| Client | Behavior with an incomplete chain |
|---|---|
| Desktop browsers (Chrome, Firefox) | Throw an error; they don't compensate for the missing intermediate over the network |
| curl and wget on Linux | On many distributions they fetch the intermediate from the local store or AIA and pass |
| Mobile clients and language libraries | Inconsistent behavior; some strict, some lenient |
| Java and some legacy stacks | Often rely on their own truststore and operate independently of the system |
So "it works on my server" proves nothing. The correct criterion is testing from a clean client with no cache.
Diagnosis: actually look at the chain
Don't guess. Read the chain the server sends directly:
openssl s_client -connect example.com:443 -servername example.com -showcerts </dev/null
In the output, look for the chain number. If you see only one Certificate chain with number 0 and then Server certificate ends, the intermediate is missing. To see a summary of the signers:
openssl s_client -connect example.com:443 -servername example.com </dev/null 2>/dev/null | openssl x509 -noout -subject -issuer
If the issuer of the leaf certificate doesn't match the subject of the root certificate and you see nothing in between, that's where the problem is. For a deeper check, save the certificate and validate it with openssl verify -CAfile chain.pem leaf.pem; if you get unable to get local issuer certificate, the chain is incomplete.
A practical note: always include the -servername value. Without it, SNI isn't sent and you may see the server's default certificate rather than your domain's certificate. People make this mistake and then spend hours chasing the wrong certificate.
The fix: order and contents of the chain file
The chain file you reference in the web server must have the leaf first and the intermediates after it. Don't add the root; it's neither necessary nor desirable.
-----BEGIN CERTIFICATE-----
(domain leaf certificate)
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
(CA intermediate certificate)
-----END CERTIFICATE-----
In Nginx you reference this file with ssl_certificate, and in Apache with SSLCertificateChainFile (in versions 2.4.8 and later you can put everything in SSLCertificateFile). After every change, run nginx -t and reload the service, not restart.
The reverse order, meaning the intermediate before the leaf, works on some clients and not on others. Don't count on it.
The cost this incurs
Every intermediate certificate you add increases the handshake size. An intermediate is typically between 1 and 2 kilobytes, and since it's sent on every new connection, it has a cumulative effect on high-traffic sites with short-lived connections. The standard solution is to enable session resumption and OCSP stapling to reduce the server's handshake cost. If you fill the chain with unnecessary extra intermediates, you're just wasting handshake bandwidth.
Second note: some CAs include the intermediate certificate in the download bundle but name the file in a way that resembles the root certificate. If you mistakenly put the root in the chain, some clients ignore it and others throw the error self signed certificate in certificate chain. The telltale sign is that the browser errors out but openssl verify passes.
An expired certificate in the middle of the chain
The more annoying case is when the leaf is healthy but the intermediate has expired. In this case the browser shows NET::ERR_CERT_DATE_INVALID and you're surprised to see that your own certificate's date is still valid. You find the cause in the notAfter of the intermediate certificate:
openssl s_client -connect example.com:443 -servername example.com -showcerts </dev/null 2>/dev/null | openssl x509 -noout -dates
If the intermediate has expired, there's nothing you can do except obtain an updated chain from the CA. This is one of the reasons you should monitor the expiration of the entire chain, not just the leaf. For periodic and automated checks, DNS and network inspection tools and certificate monitoring scripts get the job done.
If you're running on multiple servers behind a load balancer, make sure the chain is identical on all of them. A difference in the chain between nodes causes the error to appear randomly and node-dependently, which makes debugging several times harder.
When to move to the next layer up
If the chain error persists even with a correct certificate, the problem is probably elsewhere: incomplete security headers, a wrong HTTP to HTTPS redirect, or mixed content. The guide to troubleshooting SSL errors in the browser; from incomplete chain to expired certificate covers these cases. For WordPress sites, configuring security headers is usually part of the same file.
In production environments where multiple services are gathered behind one domain, manually managing the chain on each node doesn't work. Here, using ServerNet's server security services for monitoring and renewing certificates makes sense, because a chain error usually shows up at the worst possible time.
Frequently asked questions
What's the difference between a root certificate and an intermediate certificate?
The root certificate is pre-installed in the operating system or browser trust store and is self-signed. The intermediate certificate is signed by the root and its job is to sign the leaf certificate. You don't serve the root on the server, but the intermediate must be present in the chain the server sends.
Why does the browser show a chain error but curl doesn't?
Because curl on many distributions finds and completes the missing intermediate via AIA or its own local store, whereas desktop browsers don't do this and reject the incomplete chain. So testing with curl isn't a valid criterion for chain health.
Should I include the root certificate in the chain file?
No. The root is already in the client trust store, and sending it only increases the handshake size. On some clients it even causes the self signed certificate in certificate chain error. Send only the leaf and the intermediates.
With what command can I see the server's actual chain?
With openssl s_client -connect example.com:443 -servername example.com -showcerts. If you see only one certificate block in the output, the intermediate is missing. To see the expiration date of each block, pipe the same output to openssl x509 -noout -dates.
Next step: right now, grab your domain's chain with the command above and count how many blocks come back. If it's one, build the chain file with the correct intermediate and, after reloading, test from a clean client.