Guide
SSL Certificate Chains Explained: Root, Intermediate, and Leaf
Understand the SSL/TLS chain of trust — root CA, intermediate, and leaf certificates — why incomplete chains break mobile and API clients, and how to fix them.
When a browser shows the padlock next to your domain, it has just done something subtle: it followed a trail of digital signatures from your website's certificate all the way up to a certificate authority it already trusts. That trail is the certificate chain, and most real-world TLS problems are not about expiry or encryption strength at all — they are about a chain that the client cannot follow. A site can have a perfectly valid certificate and still fail for half its visitors because one link in the chain is missing.
This guide explains how the chain of trust is built from root, intermediate, and leaf certificates, why intermediates exist in the first place, how a client validates the path, and the single most common production failure — an incomplete chain that works in desktop browsers but breaks mobile apps and API clients. You will also learn exactly how to fix it and how to verify a site's chain with the SSL / TLS Check checker.
The three layers: root, intermediate, and leaf
Every publicly trusted certificate sits in a hierarchy of three kinds of certificate. At the top is the root CA certificate. Roots are self-signed and their public keys ship pre-installed in the trust stores baked into operating systems and browsers — Apple, Microsoft, Mozilla, Google, and others each maintain a list of roots they trust. You never install a root on your own server; the client already has it.
At the bottom is the leaf certificate, also called the end-entity or server certificate. This is the one issued to your specific hostname, carrying your domain in its Subject Alternative Name list and your public key. It is the certificate your web server presents first during the TLS handshake.
In between sit one or more intermediate certificates. The root CA signs an intermediate, the intermediate signs your leaf (or signs another intermediate that signs your leaf), and so on. Each certificate in the chain is signed by the one above it, which is what lets a client verify the whole structure cryptographically rather than having to trust each certificate individually.
Why intermediates exist at all
It would be simpler if the root just signed every leaf directly, so why the extra layer? The answer is risk management. A root CA's private key is the most valuable secret a certificate authority owns: if it leaks, every certificate that traces back to it becomes untrustworthy and the root must be revoked from every device on earth — a process that takes years. To protect it, the root key is kept offline, often physically air-gapped in a hardware security module that is only powered up under strict ceremony.
An offline root cannot sign millions of certificates on demand. So the CA uses the root once to sign a small number of intermediate certificates, then keeps the root locked away and does its day-to-day issuance with the intermediates. If an intermediate key is ever compromised, the CA can revoke just that intermediate and issue a new one, without disturbing the root or the trust stores it lives in. Intermediates also let a CA segment issuance — separate intermediates for different products, validation levels, or regions — and rotate them on a regular schedule.
How a client validates the chain
Validation is a path-building exercise. During the handshake, your server sends its leaf certificate and, ideally, the intermediates needed to reach a root. The client's job is to construct an unbroken path from your leaf up to a certificate already in its trust store. For each step it checks that the signature was produced by the next certificate's private key, that the certificate is within its validity window, that it has not been revoked, and that the issuing certificate is permitted to sign others.
Crucially, the client does not need — and does not want — the root certificate from your server. It already has the trusted root locally; sending the root in the chain is redundant and is simply ignored. What the client cannot supply on its own are the intermediates. Those are specific to the CA that issued your certificate, so the server is responsible for delivering them. When every link checks out and the path terminates at a trusted root, validation succeeds and the connection proceeds.
The number-one real-world problem: an incomplete chain
By far the most common chain failure is a server that sends only its leaf certificate and omits the intermediate. The leaf is valid, the key is fine, nothing has expired — yet some clients reject the connection because they cannot build a path to a trusted root. The intermediate that would bridge the gap was never sent and they have no other way to find it.
What makes this bug so insidious is that it does not fail consistently. Desktop browsers frequently cache intermediates they have encountered before, so once you (the developer) have visited a few sites from the same CA, your browser quietly fills in the missing intermediate and the site looks perfectly fine to you. Meanwhile a freshly installed mobile device, a server-to-server API call, a curl command, a payment gateway, or a monitoring probe has no such cache and fails outright. The classic symptom is "it works in my browser but the mobile app and our API integration get certificate errors." If you only ever test from your own desktop, an incomplete chain can ship to production and stay invisible for weeks.
How to fix it: serve the full chain in the right order
The fix is to configure your server to present the complete chain. This means concatenating your leaf certificate with every intermediate up to (but not including) the root, in a single PEM bundle — the file most tools call fullchain.pem. Let's Encrypt and most ACME clients generate this file for you automatically; the trap is pointing your server at cert.pem (leaf only) instead of fullchain.pem.
Order matters. The leaf certificate must come first, followed by each intermediate in sequence, working upward toward the root. Putting the intermediate before the leaf, or including the self-signed root, can cause strict clients to reject the chain even when all the right certificates are present. The rule of thumb is: leaf first, then intermediates from nearest to furthest, and never the root.
After deploying, reload the web server so it reads the new bundle, then verify from outside your own machine — not from a desktop browser that may be hiding the problem with a cached intermediate.
The AIA fetching caveat
You may have heard that an incomplete chain "works anyway," and sometimes it does, thanks to a feature called AIA fetching. The Authority Information Access extension inside a leaf certificate can include a URL pointing to the issuing intermediate. Some clients — notably certain desktop browsers — will follow that URL and download the missing intermediate themselves, silently repairing your broken chain.
Do not rely on this. AIA fetching is inconsistent across clients: many mobile platforms, command-line tools, language HTTP libraries, and server-side API clients do not perform it at all, and even where it exists it adds latency and a hard dependency on the CA's servers being reachable at handshake time. AIA fetching is a fallback, not a substitute for serving the chain correctly. The only robust configuration is one where the server hands over every intermediate itself, so that no client ever has to go looking.
How to check a site's chain
To see exactly what a server presents, run the SSL / TLS Check checker against your hostname. It performs the TLS handshake the same way a real client would, then lists each certificate the server sent — leaf, then intermediates — along with the issuer of each, the validity dates, and whether the chain resolves cleanly to a trusted root. If an intermediate is missing or the chain is out of order, that is where it shows up.
Because a broken chain can surface as a generic connection failure rather than an obvious certificate error, it helps to triangulate. The Website Status tool tells you whether the server is reachable and responding at the HTTP layer, which separates a TLS chain problem from an application or redirect issue. If the failure only happens after switching DNS to a new host or load balancer, confirm the name is resolving to the endpoint you expect with the DNS Lookup lookup tool before blaming the certificate. And once the chain is solid, run the Security Headers scanner to make sure the rest of your HTTPS configuration — HSTS, content security policy, and the other transport-hardening headers — is in good shape too.
On the command line, "openssl s_client -connect example.com:443 -servername example.com -showcerts" prints every certificate in the order the server sent it, letting you confirm the leaf comes first and the intermediates follow. Always pass the server name so SNI selects the right certificate, and remember that the absence of the root in this output is correct, not a bug.
Frequently asked questions
Do I need to install the root certificate on my server? No. The root already lives in the client's trust store and is ignored if you send it. Your server only needs to provide the leaf and the intermediates between them.
My certificate is valid but some clients reject it. This is the textbook symptom of a missing intermediate. The server is sending only the leaf, so clients without a cached intermediate cannot build a path to a trusted root. Serve fullchain.pem and re-check with the SSL / TLS Check tool.
Why does it work in Chrome but fail on my phone or in curl? Desktop browsers often cache intermediates from previous connections and may also perform AIA fetching, masking the gap. Mobile devices, curl, and API clients usually do neither, so they fail on a chain that looks fine to you. Test from a client that does not have the intermediate cached.
What order should the certificates be in? Leaf first, then each intermediate in order toward the root, with the root omitted entirely. Out-of-order bundles can be rejected by strict clients even when all the necessary certificates are present.