Lesson 09 of 16 · HTTPS and certificates
Certificate authorities and the chain of trust
Why your browser trusts a certificate it has never seen: a chain of signatures from the site's leaf certificate, through an intermediate, to a root certificate already in the trust store. Root, intermediate and leaf; where trust stores live; public versus private CAs; DV, OV and EV; how revocation works; Certificate Transparency logs and CAA records.
The problem
Your browser has never seen shop.example.com's certificate before. Anyone can create a certificate that says "I am shop.example.com" (lesson 10 does exactly that). So why does the browser believe this one?
Because it is signed by someone the browser already trusts, and that someone was signed by someone it trusts even more, ending at a root certificate that came pre-installed with the browser or operating system.
The chain of trust
┌─────────────────────────────────────────┐
│ ROOT CA certificate (self-signed) │ in the TRUST STORE of your OS/browser
│ key kept offline, valid ~20–25 years │ (about 150 roots)
└──────────────────┬──────────────────────┘
│ signs
┌──────────────────▼──────────────────────┐
│ INTERMEDIATE CA certificate │ sent by the server
│ does the daily signing, valid ~3–5 yrs │
└──────────────────┬──────────────────────┘
│ signs
┌──────────────────▼──────────────────────┐
│ LEAF (end-entity) certificate │ sent by the server
│ CN/SAN = shop.example.com, CA:FALSE │
└─────────────────────────────────────────┘
The client checks, link by link: each certificate's signature is valid using the public key of the one above, each issuer is allowed to sign (CA:TRUE), all are within their dates, the leaf's SAN matches the hostname, and the top is a root in its trust store.
You trust a new teacher because the head teacher introduced them, and you trust the head teacher because the school board appointed them, and everyone already trusts the board. The certificate chain is that chain of introductions, written down and signed at every step.
Why intermediates exist
- The root's private key is so valuable it is kept offline in a secure facility and used only rarely.
- Intermediates do the daily signing. If one is compromised, it is revoked and replaced without changing millions of trust stores.
The most common chain mistake: the server sends only its leaf, not the intermediate. Browsers often hide this (they cache or download intermediates), but curl, Java, Python and mobile apps fail with unable to get local issuer certificate. Always configure the full chain (fullchain.pem: leaf first, then intermediates; the root is not needed).
Trust stores
Every client has its own list of trusted roots:
| Client | Trust store |
|---|---|
| Debian/Ubuntu tools (curl, wget, Python requests via certifi or system) | /etc/ssl/certs/ca-certificates.crt from ca-certificates |
| RHEL/Fedora | /etc/pki/ca-trust/ |
| Windows, macOS | OS certificate store / Keychain |
| Firefox | Its own store (can also use the OS one) |
| Java | Its own cacerts keystore |
| Containers | The image's own bundle: a minimal image may have none |
That last row causes many "works on my laptop, fails in the container" problems.
Public and private CAs
| Public CA (Let's Encrypt, DigiCert, Sectigo, Google Trust Services…) | Private CA (your own) | |
|---|---|---|
| Trusted by | Every browser and OS, out of the box | Only machines you configure |
| Use for | Anything reached by the public | Internal services, mTLS, devices, labs |
| Names | Only domains you prove you control, public names | Anything, including internal names |
| Rules | Strict industry rules (CA/Browser Forum) and audits | Your own policies |
DV, OV, EV
- DV (domain validated): the CA checked you control the domain. Most certificates, including Let's Encrypt.
- OV (organisation validated) and EV (extended validation): the CA also checked the company. Browsers no longer show this specially, so for most sites DV is enough; the encryption is identical.
Revocation: cancelling a certificate early
If a private key leaks, the certificate must be cancelled before it expires:
- CRL (certificate revocation list): the CA publishes a list of revoked serial numbers.
- OCSP: a client asks the CA "is serial X still good?". Several CAs (including Let's Encrypt) have moved away from OCSP towards CRLs for privacy and reliability.
In practice revocation checking is patchy in clients, which is a big reason the industry is moving to short-lived certificates (lesson 12): a certificate that expires soon does less harm if stolen.
Watching who issues for your domains
- Certificate Transparency (CT): public CAs must log every certificate they issue in public logs. Search them (for example at crt.sh) or subscribe to alerts to spot certificates you didn't request.
- CAA DNS record: lists which CAs are allowed to issue for your domain:
example.com. CAA 0 issue "letsencrypt.org"
Recap
- Trust comes from a chain of signatures: leaf → intermediate → root in the trust store.
- Servers must send the full chain; missing intermediates break non-browser clients.
- Each client has its own trust store; containers may have none.
- Public CAs for public sites, a private CA for internal use.
- Revocation is imperfect; use CT monitoring, CAA records and short lifetimes.
This site is a public version of my personal engineering knowledge hub. It intentionally excludes confidential company information and internal operational details.