Every secure HTTPS connection, mTLS transaction, and cryptographic code signature depends on the hierarchical trust model formalized in RFC 5280: the Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile. Despite its ubiquity, certificate chain validation failures remain one of the top causes of production downtime.
1. The Three Tiers of PKI Hierarchy
An X.509 certificate chain is a directed acyclic trust graph linking an end-entity (Leaf) certificate to an air-gapped Root Certificate Authority (CA) via one or more Intermediate CAs. Each tier serves a distinct cryptographic and operational function:
| Tier | Basic Constraints | Subject vs Issuer | Operational Role |
|---|---|---|---|
| Leaf (End-Entity) | cA = FALSE |
Subject != Issuer |
Issued directly to services, hosts, or email clients. Cryptographically forbidden from issuing or signing downstream certificates. |
| Intermediate CA | cA = TRUE |
Subject != Issuer |
Subordinate authority that signs leaf certs or sub-CAs. Protects the Root CA from day-to-day exposure and enables rapid revocation if compromised. |
| Root CA | cA = TRUE |
Subject == Issuer (Self-signed) |
The ultimate trust anchor. Stored pre-installed in OS and browser local trust stores (e.g., NSS, Windows Root Store, Apple Keychain). Kept in offline, air-gapped HSMs. |
2. Essential RFC 5280 Certificate Extensions
While an X.509 certificate contains standard identity fields such as the Subject Distinguished Name (DN) and validity timestamps, its operational constraints are enforced via version 3 (v3) extensions:
Basic Constraints (OID 2.5.29.19)
The basicConstraints extension determines whether the certificate subject is a Certificate Authority. If cA is true, it may also declare a pathLenConstraint. A pathLenConstraint = 0 indicates that the CA may only issue end-entity certificates and cannot spawn further subordinate CAs. This is critical for scoping trust delegation.
Key Usage & Extended Key Usage (EKU)
Key Usage flags (OID 2.5.29.15) restrict the cryptographic operations permitted for the public key. Typical flags include:
digitalSignature: Permitted for entity authentication and data origin authentication.keyEncipherment: Used in RSA key transport where the public key encrypts a session key.keyCertSign: Exclusively permitted for CAs to verify signatures on other certificates.cRLSign: Permitted for verifying signatures on revocation lists.
Subject Alternative Name (SAN, OID 2.5.29.17) vs Common Name (CN)
In legacy standards, hostnames were validated using the Common Name (CN) field in the Subject DN. Under RFC 6125 and modern browser security requirements (CAB Forum Baseline Requirements), the Common Name is strictly deprecated for domain matching. Browsers ignore the CN entirely if SAN entries are present, and reject certificates without DNS SANs. A compliant web certificate must explicitly declare all domains, subdomains, and wildcard entries within the subjectAltName extension.
Practical Rule for Web Servers
Never include the Root CA in your web server's SSL certificate file (e.g., in Nginx ssl_certificate or Apache SSLCertificateFile). Serving the Root CA wastes bandwidth (increasing TLS handshake latency by 1–2 KB per request) and does not increase trust, because clients only trust Root CAs that already reside in their local operating system trust store. Always configure the Leaf certificate first, followed by the Intermediate CAs.
3. How Certificate Chain Traversal Works
When an HTTPS client (e.g., Chrome, Firefox, or curl) connects to a server, the server delivers its certificate bundle during the TLS ServerHello exchange:
- The client inspects the Leaf certificate, validating validity dates, SAN domain matching, and Extended Key Usage (
serverAuth). - The client matches the Leaf's
Issuer DNto theSubject DNof the provided Intermediate certificate, and uses the Intermediate's public key to verify the digital signature on the Leaf. - The client repeats this step upwards until it encounters a certificate whose
Issuer DNmatches an entry in the client's local pre-trusted Root Store. - Once a verified cryptographic link to a trusted Root CA is established, the connection proceeds. If any intermediate link is missing or forged, the client terminates the handshake with
SEC_ERROR_UNKNOWN_ISSUERorX509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY.
4. Inspecting Certificates with OpenSSL CLI
You can inspect certificates in your local terminal using OpenSSL commands:
# Decode full certificate text and extensions
openssl x509 -in cert.pem -text -noout
# Verify subject, issuer, and validity window only
openssl x509 -in cert.pem -noout -subject -issuer -dates
# Extract all Subject Alternative Names (SANs)
openssl x509 -in cert.pem -noout -ext subjectAltName
# Compute SHA-256 fingerprint
openssl x509 -in cert.pem -noout -fingerprint -sha256
Put This Guide into Practice
Test your certificates, keys, or tokens in-memory with our zero-disk developer tool.