Octet

What is a certificate chain of trust, and what does a client check before it trusts a server certificate?

Show the answer

Say this first

A server certificate (the leaf) binds a public key to names and is signed by an intermediate CA, which is signed by a root CA that the client already trusts in its store. The server sends the leaf plus the intermediates; the client builds a path to a trusted root and checks each signature, the validity dates, that the hostname matches a Subject Alternative Name, that the key usage allows server authentication, that each issuer is really a CA, and revocation and certificate transparency where its policy requires. A missing intermediate is the classic outage.

Go deeper

The chain

Output
Root CA            (self-signed, in the OS or browser trust store, not sent by the server)
  signs ->  Intermediate CA   (sent by the server)
              signs ->  Leaf: shop.example.com   (sent by the server, first)

Roots stay offline; intermediates do daily issuing so a compromise can be contained.

Checks, in the order a client roughly applies them

  1. Build a path from leaf to a trusted root using what the server sent and the local store.
  2. Each certificate's signature verifies with its issuer's public key.
  3. Every certificate is within its notBefore and notAfter dates.
  4. Issuers have Basic Constraints CA:TRUE, and path length and name constraints are respected.
  5. The leaf's Extended Key Usage includes serverAuth.
  6. The hostname matches a DNS name in the SAN. Browsers ignore the Common Name.
  7. Revocation (CRLs, or OCSP where the CA still runs it; CRLs are now the required method for public CAs) and, in browsers, certificate transparency proofs.

Wildcards

*.example.com matches shop.example.com, but not example.com and not a.shop.example.com. The wildcard covers exactly one label.

Lifetimes are shrinking

The CA/Browser Forum has voted to cut the maximum lifetime of public TLS certificates in steps, down to 47 days by 2029. Renewal has to be automated, usually with ACME.

Traps

  • Saying the browser checks the Common Name. Modern clients only match the SAN.
  • Fixing a chain error by installing the intermediate on one client. Fix the server so every client works.
How did you do?Book 8.3 Key PredistributionBook 8.5 Example Systems