SSL Certificates and the Chain of Trust
On this page
Why certificates exist
TLS proves the server holds a private key (Day 16). But how do you know that key belongs to example.com and not to an attacker? A certificate answers this: a document saying "this public key belongs to these names", signed by a certificate authority (CA) that your browser or operating system already trusts.
What's inside a TLS certificate
- Subject Alternative Names (SANs): the hostnames it covers, such as
example.comand*.example.com. Browsers check this field, not the older Common Name. - Public key of the server.
- Validity period: not before and not after dates. Under CA/Browser Forum rules, public certificates have been limited to 200 days since March 2026, dropping to 100 days in 2027 and 47 days in 2029.
- Issuer: the CA that signed it, and the CA's signature.
The certificate chain of trust
CAs don't sign servers' certificates with their root keys, which are kept offline. The chain looks like:
- Root certificate: self-signed, pre-installed in the operating system or browser trust store.
- Intermediate certificate(s): signed by the root, used for day-to-day issuing.
- Leaf certificate: your server's, signed by an intermediate.
The server sends its leaf and the intermediates. The client builds a path up to a root it trusts, checking each signature, the dates, the hostname, and revocation status.
Reading a certificate chain with openssl
echo | openssl s_client -connect example.com:443 -servername example.com -showcerts 2>/dev/null | grep -E '^ *[0-9] s:|^ *i:'
echo | openssl s_client -connect example.com:443 -servername example.com 2>/dev/null | openssl x509 -noout -subject -issuer -dates 0 s:/CN=example.com
i:/C=US/O=SSL Corporation/CN=Cloudflare TLS Issuing ECC CA 3
1 s:/C=US/O=SSL Corporation/CN=Cloudflare TLS Issuing ECC CA 3
i:/C=US/O=SSL Corporation/CN=SSL.com TLS Transit ECC CA R2
2 s:/C=US/O=SSL Corporation/CN=SSL.com TLS Transit ECC CA R2
i:/C=US/O=SSL Corporation/CN=SSL.com TLS ECC Root CA 2022
3 s:/C=US/O=SSL Corporation/CN=SSL.com TLS ECC Root CA 2022
i:/C=GB/ST=Greater Manchester/L=Salford/O=Comodo CA Limited/CN=AAA Certificate Services
subject= /CN=example.com
issuer= /C=US/O=SSL Corporation/CN=Cloudflare TLS Issuing ECC CA 3
notBefore=Sep 26 22:49:11 2026 GMT
notAfter=Dec 25 22:56:35 2026 GMTEach certificate's issuer (i:) is the next one's subject (s:). Certificate 3 is a cross-signed root: a newer root signed by an older, more widely trusted one, so older devices that lack the new root can still build a path. And note the validity: 90 days. Short-lived, automatically renewed certificates are the norm.
ACME, Let's Encrypt and certificate renewal
- ACME (the protocol behind Let's Encrypt) automates issuing and renewal. The CA checks you control the domain with an HTTP file (HTTP-01) or a DNS TXT record (DNS-01, needed for wildcards).
- Cloud load balancers and CDNs manage certificates for you.
- Certificate Transparency: every public certificate is logged publicly. You can monitor the logs (for example on crt.sh) for certificates issued for your domains that you didn't request.
- CAA records (Day 12) restrict which CAs may issue for your domain.
Common certificate errors and fixes
| Error | Cause | Fix |
|---|---|---|
| Certificate expired | Renewal failed or wasn't automated | Automate with ACME; alert at 14 to 30 days before expiry |
| Hostname mismatch | The name isn't in the SANs | Issue a certificate covering that name; check SNI |
| Unable to get local issuer | Server didn't send intermediates | Serve the full chain file, not just the leaf |
| Self-signed in chain | Internal CA not trusted by the client | Add your internal root to the client's trust store |
Missing intermediates are sneaky: browsers often fetch or cache them, so the site works in Chrome while curl, Java or mobile clients fail.
Check yourself
Root keys stay offline for safety; if an intermediate is compromised, it can be revoked without replacing roots in every device's trust store.
The server isn't sending its intermediate certificates. The browser filled the gap from its cache or by fetching them, but curl can't. Configure the server with the full chain file, the leaf followed by the intermediates.
Monitor Certificate Transparency logs, where every publicly trusted certificate must be recorded. Services like crt.sh or CT monitoring tools can alert you when a new certificate appears for your domains.
Short lifetimes limit the damage from a stolen key and push everyone to automate renewal with ACME, which then rarely fails silently.
The hostnames the certificate is valid for. Browsers check the requested hostname against the SAN, not the older Common Name field.