The missing intermediate certificate
Last updated:
An intermediate certificate is the middle link of the TLS chain: the CA certificate that signed your site’s certificate and was itself signed by a root. When a server fails to send it, the leaf certificate — valid dates, correct names, matching key — becomes unverifiable, because the client cannot build a path from it to a root it trusts. It is the most common cause of “certificate not trusted” errors on sites whose certificates are perfectly good, and the most confusing, because your browser may never show it. This article explains how the chain is supposed to be assembled, why browsers paper over the gap, and the order to debug in. If you have a certificate and its chain files in front of you, the certificate & key matcher will verify the links signature by signature; read on for what it is checking.
A chain is three links — and the server owes you two of them
Every TLS certificate belongs to a hierarchy. At the top sits a root CA, whose self-signed certificate ships inside the trust store of your operating system or browser — it is trusted because it is on the list, not because anyone presents it. At the bottom is your site’s leaf certificate, issued for your names. Between them sits at least one intermediate CA: the root signs the intermediate, the intermediate signs your leaf, and each signature is what the next link’s trust rests on. Modern public CAs never sign site certificates directly from the root; the root key stays offline, and intermediates do the daily issuing.
The division of labour at handshake time follows from that. The client already has the root — sending it would prove nothing, since trust comes from the store, not the wire. Everything else, the server must send: the leaf first, then every intermediate in signing order, so the client can walk leaf → intermediate → root and verify each signature with the public key of the link above it. Omit an intermediate and the walk stops mid-air: the client holds a certificate signed by an authority it has never heard of, with no way to connect it to a root it trusts. The leaf has not changed — it is still in date, still names your site, still pairs with your key. What is missing is its ancestry.
What a broken chain looks like from the outside
The error messages name the path, never the leaf. OpenSSL — and with it curl, most command-line tooling and a large share of server-to-server calls — reports Verify return code: 21 (unable to verify the first certificate) or unable to get local issuer certificate. Java applications fail with PKIX path building failed. Browsers that do show it say the certificate is not trusted, or not issued by a trusted authority — NET::ERR_CERT_AUTHORITY_INVALID in Chrome’s wording. None of them say “expired” or “wrong name”, because neither is true; they say, in each toolkit’s dialect, “I cannot connect this certificate to a root I trust”.
That is also why inspecting the leaf alone clears it. Decode the certificate and everything checks out: the validity window is current, the SAN list covers the hostname, the issuer field names a CA you recognise, and the key matches — the pairing the matcher verifies. The issuer field is the tell, once you know to look: it names the intermediate, not the root. If that intermediate is neither in the handshake nor in the client’s store, the name in the issuer field belongs to a stranger as far as path building is concerned, however reputable the CA behind it. To read any single certificate in the chain field by field — issuer, SANs, the AIA extension the next section leans on — the certificate parser is the right tool.
One more disguise: the same defect can present as an expired-certificate error on some clients, when the only path they can build runs through a cross-signed intermediate whose alternate route has lapsed. The leaf’s dates are still fine. Any diagnosis that starts from “the certificate looks valid” and stops there will miss this entire family; the unit of correctness is the chain as presented, not the certificate as a file.
Why your browser swears the site is fine
Browsers cheat, helpfully. Most certificates carry an Authority Information Access extension with a caIssuers URL — a download address for the issuing intermediate, printed on the leaf itself. Chrome and Firefox will fetch a missing intermediate from that URL mid-handshake, complete the chain themselves, and show a clean padlock for a server that is, strictly speaking, misconfigured. They also cache intermediates: once any site has presented an intermediate, the browser remembers it and silently supplies it for every later site that forgets to send it. Between fetching and caching, a desktop browser in daily use almost never exposes a missing intermediate.
Strict clients do neither. curl and OpenSSL do not chase AIA URLs. Python’s and Java’s TLS stacks build paths only from what the server sent plus what their trust store holds. Mobile apps, API clients, webhook senders, monitoring probes, mail servers verifying TLS, and older or embedded devices with frozen trust stores all live on the strict side of the line. The result is the signature incident report of this defect: it works in every browser anyone tests with, and fails for the payment provider’s callback, the mobile app and the uptime checker. “It loads for me” is evidence about your browser’s cache, not about your server.
Intermediates rotate — yesterday’s chain file is a liability
Intermediates are working certificates with working lifetimes, and CAs replace them: new keys, new names, new signing arrangements every few years. Let’s Encrypt’s public history is the best documented. Its early leaves were signed through IdenTrust; then came its own R3 and E1 intermediates under ISRG Root X1, with that root also cross-signed by IdenTrust’s DST Root CA X3 so older devices had a path to it. When DST Root CA X3 expired in September 2021, clients that only trusted the old path — famously older Android devices and old OpenSSL versions — began rejecting Let’s Encrypt sites whose own certificates were months away from expiry. In 2024 the cross-sign was retired altogether and fresh intermediates took over. Nothing about any individual site’s certificate changed at those moments; the ancestry around it did.
The operational lesson is that a chain is not a file you compose once. Servers configured by hand often carry a chain bundle copied from a previous certificate, a previous CA or a tutorial — and it keeps working right up until a strict client or a CA rotation exposes it. The robust habit is the opposite: at every issuance and renewal, deploy exactly the chain the CA issued alongside that certificate — the fullchain file in ACME terms, leaf plus its current intermediates — and treat any chain file whose provenance you cannot state as suspect. When the matcher shows your leaf was signed by an intermediate your server does not send, it has usually found a bundle left over from the certificate’s predecessor.
The debugging order: handshake first, trust store last
Work from the wire inward. First, look at what the server actually sends — not which files sit on disk, but what a handshake returns: openssl s_client -connect your.host:443 -showcerts, or the chain view of an external checker such as this site’s SSL checker. Count the certificates presented. One is a leaf flying alone; leaf plus one or two intermediates is normal; the root appearing in the list is wasted bytes but harmless. Second, compare against what your CA currently issues for that leaf — the intermediate names must be the ones that signed this certificate, not its predecessor.
Third, test like a strict client: curl from a clean machine or container, with no browser cache to rescue you, and ideally the actual failing client — the app, the webhook consumer, the old device. If curl succeeds and the app still fails, the server side is done and the remaining suspect is the client’s trust store: a root too new for an old device, a store frozen before a CA change. That is a different fix — update the client, or serve a chain with a cross-sign to an older root while your CA still offers one — and it is why the trust store comes last: it is the only step that is somebody else’s machine.
And the fix itself, in the common case, is one file: replace the certificate bundle on the server with the full chain as issued — leaf first, intermediates after it in signing order — reload, and re-run the strict test. Do it at the next renewal even if nothing is broken today, and the rotation described above becomes a non-event. A chain you never look at is a chain that is quietly ageing; the handshake takes a second to inspect.