Certificate chain

On this page 7

A certificate chain, also called a chain of trust or certification path, is the ordered sequence of X.509 certificates that links an end-entity certificate, such as a website’s TLS certificate, through one or more intermediate certificates to a trusted root certificate. In Internet trust, a client accepts a server’s identity only when it can build and validate such a chain up to a root it already trusts.

The chain exists because root keys are too valuable to use every day. A certificate authority keeps its root key offline and signs intermediate certificates, which in turn sign customer certificates. Each link is a digital signature made by the issuer above it, so trust flows downward from a small set of roots stored in operating systems and browsers.

A typical web chain has three levels: leaf, one intermediate and root. Some chains include two intermediates or a cross-signed certificate, but longer chains add bytes to every handshake and more opportunities for misconfiguration.

CertificateSigned byWhere it is storedTypical validity
Leaf or end-entityIntermediate CASent by the serverUp to 398 days, often 90 days
Intermediate CARoot CA or another intermediateSent by the serverSeveral years
Root CAItself (self-signed)Client trust storeOften 15 to 25 years
Roles in a typical certificate chain

The links are connected by matching fields. The Issuer name of each certificate equals the Subject name of the certificate above it, and the Authority Key Identifier of the lower certificate matches the Subject Key Identifier of the upper one. Intermediates carry a Basic Constraints extension with CA set to true, which a leaf must never have.

How clients build and validate the chain

Validation follows the path validation algorithm of RFC 5280. The client receives the leaf and intermediates in the TLS handshake, orders them, and searches its trust store for a root that issued the top certificate. It then verifies each signature from the root downward and checks constraints on every certificate along the path.

  1. Signature check: each certificate’s signature verifies with the public key of its issuer.
  2. Validity period: the current time lies between notBefore and notAfter for every certificate.
  3. Name and purpose: the leaf’s Subject Alternative Name matches the host name, and Extended Key Usage permits server authentication.
  4. Constraints: Basic Constraints, path length limits and name constraints are respected.
  5. Revocation status: no certificate is revoked according to OCSP, CRLs or browser-pushed revocation lists.

Clients differ in how they fill gaps. Some browsers fetch a missing intermediate using the Authority Information Access URL or a cached copy, while many command-line tools, mobile apps and IoT devices fail immediately. A chain that works in one desktop browser can therefore still be broken for other clients.

The certificate chain is one concrete mechanism inside a wider public key infrastructure (PKI). The table separates it from neighboring concepts that are often confused with it.

ConceptWhat it isRelation to the chain
Certificate authorityOrganization that issues certificatesOperates the root and intermediates
X.509Certificate format standardDefines the fields each link uses
PKIWhole system of keys, CAs and policiesThe chain is its validation path
Trust storeList of trusted root certificatesAnchors the top of the chain
OCSPOnline revocation status protocolChecks whether a link was revoked
HSTSPolicy forcing HTTPS for a hostRequires a valid chain, no click-through
Certificate chain and neighboring concepts

Configuring a server chain correctly

A server must send the leaf certificate first, followed by its intermediates in order. Sending the root is unnecessary, because the client must already hold it to trust the chain, and it only enlarges the handshake. Most CAs supply a full chain file for exactly this purpose.

SituationRecommended choiceReason
Standard web serverServe leaf plus all intermediatesWorks for clients that do not fetch missing links
Older client devicesChoose a chain to a long-established rootOld trust stores lack newer roots
Cross-signed root availableTest which path clients actually buildExpired cross-signs can break old clients
Automated renewalReload the full chain after each renewalCAs can change intermediates without notice
Internal servicesDistribute the private root to all clientsAvoids disabling verification
Chain configuration decisions

Common chain errors and their causes

Most chain failures come from configuration, not cryptography. The symptoms below appear in browser warnings, monitoring tools and client error logs.

SymptomLikely causeFix
Unable to get local issuer certificateMissing intermediateInstall the CA’s full chain file
Certificate has expiredExpired leaf or intermediateRenew and reload the chain
Self-signed certificate in chainPrivate root not in trust storeDistribute the root or use a public CA
Works in browsers, fails in appsBrowser fetched a missing intermediateServe the complete chain
Name mismatchHost absent from Subject Alternative NameReissue with the correct names
Symptoms, causes and fixes

A dangerous workaround is to disable certificate verification in client code to make an error disappear. This removes the protection the chain provides and exposes the connection to man-in-the-middle attacks, so the chain itself must be fixed instead.

A non-technical view

Think of a letter of recommendation. You do not know the person who wrote it, but their letter is countersigned by a manager, and that manager’s authority is confirmed by a company you already trust. Each signature vouches for the one below it.

A certificate chain works the same way for websites. Your device trusts a small number of top-level authorities. When a site shows its certificate, it also shows the middle links that connect it to one of those authorities. If any link is missing, expired or forged, your browser warns you, because it cannot trace the site back to someone it trusts.

A concrete example

An online booking service renews its TLS certificate and, during the change, installs only the new leaf certificate. Desktop browsers keep working because they retrieve the missing intermediate automatically. Within an hour, however, the support team receives reports that the mobile app and a partner’s payment callback both fail with an untrusted certificate error.

An engineer runs a chain test and sees that the server sends a chain of length one. She replaces the file with the CA’s full chain of leaf plus intermediate, reloads the web server and verifies the result with several clients. All connections recover immediately, and the team adds an automated check that alerts whenever the served chain is incomplete or any certificate in it expires within 21 days.