Certificates and PKI: X.509, Certificate Authorities, Validation, Revocation and Transparency
How public keys are bound to names with X.509 certificates, how certificate authorities and chains of trust work, what a client checks during validation, how revocation (CRLs, OCSP) and Certificate Transparency work in 2026, and why lifetimes are shrinking, tested with a lab CA.
kvi5hnuCode Sprout team member18 min readOn this page
Article 79 ended with a problem: Diffie-Hellman agrees on a key with someone, but only authentication tells you who. To check a signature you need the signer's public key, and you need to be sure it really belongs to them. If Mallory can hand you a public key and claim it's www.example.com's, all the cryptography is for nothing.
A certificate solves this. It's a signed statement from a third party: "this public key belongs to this name, for this period." The system of authorities, certificates, policies and software that makes such statements trustworthy is a public key infrastructure (PKI). This article builds a small one in the course lab and tests it the way TLS clients do.
X.509 certificates
Internet certificates use the X.509 version 3 format, profiled for the Internet by RFC 5280. Here's the server certificate issued by the lab's CA:
Version: 3 (0x2)
Serial Number: 4096 (0x1000)
Signature Algorithm: ecdsa-with-SHA256
Issuer: CN=Example Lab Issuing CA 1, O=Example Lab
Validity
Not Before: Nov 20 23:38:36 2026 GMT
Not After : Feb 18 23:38:36 2027 GMT
Subject: CN=www.example.com
Subject Public Key Info:
Public Key Algorithm: id-ecPublicKey
Public-Key: (256 bit)
X509v3 extensions:
X509v3 Basic Constraints: critical
CA:FALSE
X509v3 Key Usage: critical
Digital Signature
X509v3 Extended Key Usage:
TLS Web Server Authentication
X509v3 Subject Key Identifier:
b11c4eb1d0d3406d005e410ae0f17d69f21bf5b2 (SHA-1 of the key)
X509v3 Authority Key Identifier:
e5c76422c74181b0d8e2d7f5bcaa1cb2bb63ca2c (SHA-1 of the key)
Authority Information Access:
OCSP - URI:http://ocsp.example.com:8888
CA Issuers - URI:http://ca.example.com/int.crt
X509v3 CRL Distribution Points:
Full Name:
URI:http://crl.example.com/int.crl
X509v3 Subject Alternative Name:
DNS:www.example.com, DNS:example.com
The main fields:
- Serial number: unique among certificates from this issuer. Revocation lists refer to certificates by serial number.
- Signature algorithm: how the issuer signed it, here ECDSA with SHA-256.
- Issuer: the CA that signed it, as a distinguished name (
CN=…, O=…). - Validity:
notBeforeandnotAfter. This one is valid for 90 days. - Subject: who it's for. For TLS server certificates, the subject's common name is legacy: clients use the Subject Alternative Name (SAN) extension.
- Subject public key info: the algorithm and the public key itself, here a 256-bit elliptic curve key.
And the extensions, which carry most of the policy:
- Basic Constraints says whether this is a CA certificate (
CA:FALSEhere), and for CAs, how many further CA levels may follow (pathlen). - Key Usage limits what the key may do (
Digital Signature), and Extended Key Usage limits it to purposes such asTLS Web Server Authentication. - Subject and Authority Key Identifiers are hashes of the keys, which help clients match a certificate to its issuer when a CA has several keys.
- Authority Information Access says where to get the issuer's certificate (
CA Issuers) and where to ask about revocation (OCSP, the Online Certificate Status Protocol, covered below). - CRL Distribution Points says where to download the CRL, the certificate revocation list.
- Subject Alternative Name lists the names the certificate is valid for:
www.example.comandexample.com. SANs can also hold IP addresses, email addresses and URIs (uniform resource identifiers, such ashttps://example.com/).
Extensions marked critical must be understood by the client; if a client doesn't recognize a critical extension, it must reject the certificate.
Certificates are binary DER encodings of ASN.1 structures (Abstract Syntax Notation One, a language for describing data records), usually stored base64-encoded as PEM with -----BEGIN CERTIFICATE----- lines. They're not small:
root.pem 526 bytes DER O=Example Lab, CN=Example Lab Root CA
int.pem 539 bytes DER CN=Example Lab Issuing CA 1, O=Example Lab
www.pem 638 bytes DER CN=www.example.com
A server sends its leaf and intermediate in every full TLS handshake, about 1.2 KB here with elliptic curve keys. RSA keys and post-quantum signatures make them much bigger.
Certificate authorities and chains of trust
A certificate authority (CA) is an organization that checks that an applicant controls a name and then signs a certificate for it. For publicly trusted TLS certificates, the minimum check is domain validation (DV): proving control of the domain, usually by serving a token over HTTP, adding a DNS record, or answering a TLS challenge. The ACME protocol (RFC 8555), used by Let's Encrypt and many other CAs, automates that. Organization validation (OV) and extended validation (EV) also check the legal identity of the organization, but browsers no longer show them differently.
CAs don't sign servers' certificates with their root keys. The structure has levels:

- A root CA certificate is self-signed: its issuer and subject are the same, and nothing vouches for it except its presence in the client's trust store. Operating systems and browsers ship trust stores with roughly 100 to 150 roots, chosen by root programs (Mozilla, Apple, Microsoft, Google) that audit the CAs. The CA/Browser Forum's Baseline Requirements set the common rules.
- Root keys are kept offline. They sign intermediate (issuing) CA certificates, and those sign the leaf (end-entity) certificates. If an intermediate is compromised, it can be revoked without replacing the root in every device.
The server sends the leaf and the intermediates. The client builds a certification path from the leaf up to a root it trusts. Here's the lab server's chain as openssl s_client received it, with the lab root as the only trusted certificate:
0 s:CN=www.example.com
i:CN=Example Lab Issuing CA 1, O=Example Lab
1 s:CN=Example Lab Issuing CA 1, O=Example Lab
i:O=Example Lab, CN=Example Lab Root CA
Verification: OK
Verify return code: 0 (ok)
s: is each certificate's subject and i: its issuer. Each certificate's issuer is the next one's subject, and the last issuer is in the trust store.
Validation, and what failure looks like
A client validating a server certificate checks, in essence:
- A path exists from the leaf, through the supplied intermediates, to a trusted root.
- Each signature verifies with the public key of the certificate above it.
- The current time is within each certificate's validity period.
- The name the client wanted matches a SAN entry (a wildcard
*.example.commatches one label, such aswww.example.com, but nota.b.example.com). - Constraints and usage: every CA certificate has
CA:TRUE, path lengths and name constraints are respected, and the leaf's key usage and Extended Key Usage (EKU) allow TLS server authentication. - Revocation, if the client checks it.
The lab tests these with openssl verify. With everything right:
www.pem: OK
And with one thing wrong each time:
$ no intermediate supplied
error 20 at 0 depth lookup: unable to get local issuer certificate
error www.pem: verification failed
$ wrong name: mail.example.com
error 62 at 0 depth lookup: hostname mismatch
error www.pem: verification failed
$ expired certificate
error 10 at 0 depth lookup: certificate has expired
error exp.pem: verification failed
$ chain ends at a root the client doesn't trust
error 19 at 2 depth lookup: self-signed certificate in certificate chain
error www.pem: verification failed
$ revoked, checked with the CRL
error 23 at 0 depth lookup: certificate revoked
error old.pem: verification failed
In error 20 at 0 depth, the first number is OpenSSL's error code and the depth says which certificate failed: 0 is the leaf, 1 the intermediate, 2 the root.
- No intermediate supplied is the most common real-world misconfiguration: a server sends only its leaf. Some browsers paper over it by caching or fetching intermediates (using the
CA IssuersURL), so the site "works in one browser but not another," and command-line tools and API clients fail. - Hostname mismatch is what you see when the certificate covers
www.example.combut you connected tomail.example.com, often through a shared IP address or a misconfigured virtual host. - Expired certificates are the classic outage, and the reason for automation.
- Self-signed certificate in the chain means the path ended at a root the client doesn't trust. It's what you get from a private CA, from a TLS-inspecting corporate proxy, or from Mallory.
- Revoked appears only if the client actually checks revocation, which leads to the next problem.
Revocation
A certificate can need revoking before it expires: its private key leaked, the domain changed hands, or it was mis-issued. There are two standard mechanisms.
Certificate Revocation Lists
A CRL is a list of revoked serial numbers, signed by the CA, published at the URL in the certificate's CRL Distribution Points extension, and reissued regularly. The lab CA revoked old.example.com with reason keyCompromise:
Issuer: CN=Example Lab Issuing CA 1, O=Example Lab
Last Update: Nov 20 23:38:36 2026 GMT
Next Update: Nov 27 23:38:36 2026 GMT
Serial Number: 1001
Revocation Date: Nov 20 23:38:36 2026 GMT
CRL entry extensions:
X509v3 CRL Reason Code:
Key Compromise
Next Update says when the client should fetch a new one; until then, a newer revocation can't be known. CRLs from big CAs can be megabytes, so CAs split them into shards, and browsers don't download them directly. Instead, browser vendors aggregate CRLs from all CAs and push compressed summaries to their browsers: Firefox's CRLite and Chrome's CRLSets.
OCSP
The Online Certificate Status Protocol (OCSP, RFC 6960) asks the CA about one certificate at a time. The lab runs an OCSP responder using the CA's database:
$ query www.example.com
www.pem: good
This Update: Nov 20 23:38:37 2026 GMT
$ query old.example.com
old.pem: revoked
This Update: Nov 20 23:38:37 2026 GMT
Reason: keyCompromise
Revocation Time: Nov 20 23:38:36 2026 GMT
The responder answers good for the valid certificate and revoked, with the reason and time, for the revoked one. This Update is when the responder produced that answer: clients can cache an answer for a while, so its age matters.
OCSP gives fresh answers, but it has serious problems. The client tells the CA which sites it visits (a privacy leak). The responder is a single point of failure, so browsers soft-fail: if there's no answer, they accept the certificate anyway, which means an attacker who can block OCSP can block revocation. OCSP stapling has the server fetch a signed OCSP response and include it in the TLS handshake, which fixes privacy and availability but needs server support.
The industry is moving away from OCSP. Since March 2024 (ballot SC-063, passed in 2023), the Baseline Requirements make OCSP optional for publicly trusted CAs while CRLs remain required. Let's Encrypt, the largest CA, removed OCSP URLs from its certificates in May 2025 and shut down its OCSP service in August 2025; it now publishes CRLs only.
Short-lived certificates
The other answer to revocation is to make it matter less: a certificate that expires in days is only briefly dangerous if its key leaks. Since January 2026, Let's Encrypt offers opt-in certificates valid for 160 hours (about 6 days), which carry no revocation URLs at all. And the maximum lifetime for every publicly trusted TLS certificate is shrinking:

CA/Browser Forum ballot SC-081 (2025) set the schedule: 200 days from March 15, 2026, 100 days from March 15, 2027, and 47 days from March 15, 2029. The period for which a CA may reuse a domain validation shrinks to 10 days by 2029. In practice, that makes manual renewal impossible: certificates have to be renewed automatically with ACME or a similar protocol.
Certificate Transparency
Revocation only helps once someone notices a bad certificate. A CA that is hacked, coerced or careless can issue a certificate for your domain to someone else, and you'd never see it. Certificate Transparency (CT, RFC 6962) makes issuance public. RFC 9162 (CT version 2.0, Experimental) formally replaced it in 2021, but browsers and CAs still use the RFC 6962 formats. What has changed is how logs are run: newer "tiled" logs (the Static CT API, used by Let's Encrypt's Sunlight logs) accept the same submissions but serve their data as cacheable files, and browsers now accept them.
- CAs submit every certificate (or a precertificate before issuing it) to several independent, append-only CT logs, built on Merkle trees so that nobody can quietly remove an entry.
- Each log returns a signed certificate timestamp (SCT), a promise to include the certificate. The CA embeds the SCTs in the certificate, or the server delivers them in the TLS handshake or in a stapled OCSP response.
- Browsers require SCTs: Chrome, Safari and (since version 135 in 2025, on desktop) Firefox reject publicly trusted certificates that don't have enough SCTs from approved logs.
- Monitors watch the logs, so domain owners can be alerted when any certificate for their names appears.
The lab CA is private and never submitted anything to a log, so its certificate has no SCT extension:
No extensions in certificate
A browser would reject this certificate if it chained to a public root. Private CAs, which browsers trust only because an administrator installed their root, are exempt. You can search the public logs for your own domains with services such as crt.sh. CT has caught real mis-issuance several times, and has led to CAs being removed from trust stores.
Attribute certificates
An X.509 attribute certificate (RFC 5755) binds attributes, such as a role, a group membership or a clearance, to an identity rather than binding a public key. It has no public key of its own; it refers to the holder's ordinary public key certificate. An attribute authority, which may be different from the CA, signs it, and it can be short-lived while the identity certificate lasts longer. Attribute certificates are used in a few authorization systems, but most of the Internet carries authorization in other ways, such as tokens and directory lookups.
Other trust models, formats and services
The CA hierarchy isn't the only way to bootstrap trust in a key.
- In a web of trust, used by PGP (Pretty Good Privacy) and its standard form OpenPGP (RFC 9580), there's no central authority. Users sign each other's keys, and you accept a key if enough people you already trust (or particular ones) have endorsed it. It has no single point of failure, but a newcomer's key can take a long time to collect useful endorsements, which is why key-signing parties exist. It never caught on outside email encryption and software signing.
- Trust on first use (TOFU), as in SSH, remembers the key a server presented the first time and warns if it ever changes. It protects every connection except the first.
Certificates and keys travel in several file formats: DER (binary), PEM (base64 DER with header lines), PKCS #7 (.p7b, a bundle of certificates, the basis of the Cryptographic Message Syntax, RFC 5652) and PKCS #12 (.pfx or .p12, a password-protected bundle of a private key with its certificate chain, common on Windows and for importing client certificates).
A certificate can also name the certificate policies it was issued under, as object identifiers in its Certificate Policies extension, with a pointer to the CA's certification practice statement (CPS), the document describing how the CA checks identities and protects its keys. Publicly trusted certificates include a policy OID that says whether they're DV, OV or EV. Historically, some CAs also sold numbered certificate "classes" for individuals, organizations or servers, with stricter identity checks for higher classes.
Validation can be outsourced, too. The Server-Based Certificate Validation Protocol (SCVP, RFC 5055) lets a client ask a trusted server to build a path (delegated path discovery) or to build and validate it (delegated path validation), which also applies a consistent policy across an organization. It's rarely deployed.
Common questions
Why do servers send intermediates but not the root?
The client must already have the root in its trust store, or the chain is worthless, so sending it wastes bytes. The client can't be expected to have every intermediate, because CAs create new ones often.
Is a self-signed certificate insecure?
The cryptography is the same. The problem is trust: nothing tells the client the key is the right one. A self-signed certificate is fine if the client is configured to trust exactly that certificate or a private root, as in a company's internal network. On the public Internet it gives no protection against Mallory.
What does a TLS-inspecting firewall do with certificates?
It terminates the TLS connection, and generates a certificate for the destination on the fly, signed by its own CA. That only works on devices whose administrators have installed that CA's root, which is why such devices exist mostly in corporate networks.
Why are certificate lifetimes getting so short?
Revocation doesn't work reliably, so the main protection against a compromised key or a stale domain validation is expiry. Shorter lifetimes also make algorithm changes, such as moving to post-quantum signatures, faster. The cost is that renewal must be automated.
What happens when a CA is distrusted?
Root programs remove its roots (or stop trusting new certificates from it after a date), and every site with its certificates must switch CAs. It has happened several times after serious compliance failures, which shows the system's real enforcement mechanism: the browsers.
Can I stop other CAs from issuing certificates for my domain?
Partly. A CAA DNS record (RFC 8659), such as example.com. CAA 0 issue "letsencrypt.org", lists the CAs allowed to issue for a name. Publicly trusted CAs must check it before issuing (a Baseline Requirements rule since 2017) and refuse if they aren't listed. It stops honest CAs from mis-issuing by mistake, not a compromised CA that ignores it, which is why Certificate Transparency monitoring is still needed.
Do I need OCSP stapling in 2026?
It still helps for CAs that run OCSP, but it matters less every year. Major browsers rely on their own CRL-based systems, Let's Encrypt has no OCSP at all, and short lifetimes limit the damage anyway.
Summary
- An X.509 certificate is a CA's signature over a name (in the SAN extension), a public key, a validity period and usage constraints. Extensions marked critical must be understood.
- Roots are self-signed and trusted because they're in the trust store. They sign intermediates, which sign leaves. Servers send leaf and intermediates; clients build a path to a trusted root.
- Validation checks the path, signatures, dates, name, constraints and usage, and sometimes revocation. In the lab: missing intermediate (error 20), hostname mismatch (62), expired (10), untrusted root (19) and revoked (23).
- CRLs are signed lists of revoked serials; OCSP answers per certificate but leaks privacy and soft-fails. Browsers use aggregated CRLs, OCSP is optional for public CAs, and Let's Encrypt has shut OCSP down.
- Maximum lifetimes drop to 200 days (March 2026), 100 (2027) and 47 (2029); Let's Encrypt offers 160-hour certificates. Renewal must be automated, typically with ACME.
- Certificate Transparency logs every public certificate; browsers require SCTs, and monitors let domain owners spot mis-issuance.
- Attribute certificates bind attributes, not keys, to an identity. Webs of trust (OpenPGP) and trust on first use (SSH) bootstrap trust without CAs. PEM, DER, PKCS #7 and PKCS #12 are the usual file formats.
Practice questions
1. A certificate's SAN contains *.example.com and example.com. Which of these names does it cover: www.example.com, example.com, api.eu.example.com, www.example.org?
Answer
www.example.com (by the wildcard, which matches exactly one label) and example.com (listed explicitly). Not api.eu.example.com, because the wildcard doesn't match two labels, and not www.example.org.
2. Users of one browser can reach a site, but curl fails with "unable to get local issuer certificate." What is the likely cause and fix?
Answer
The server isn't sending its intermediate certificate. The browser probably had the intermediate cached or fetched it from the AIA (Authority Information Access) CA Issuers URL; curl doesn't. Fix the server's configuration to send the full chain (leaf followed by intermediates).
3. Why does a CA need pathlen:0 on an issuing CA certificate?
Answer
It means no further CA certificates may appear below it: it can sign only leaf certificates. Without the constraint, a compromised issuing CA (or a customer given a CA certificate by mistake) could create subordinate CAs that the clients would still trust.
4. An attacker steals a server's private key and the owner revokes the certificate within an hour. With OCSP soft-fail, how can the attacker still use the stolen key?
Answer
By also blocking the victim's access to the OCSP responder (as an on-path attacker can). A soft-failing client that gets no OCSP answer accepts the certificate. That's one reason browsers moved to pushed CRL summaries and the industry to short lifetimes.
5. A certificate was valid for 47 days and is renewed when a third of its lifetime remains. Roughly how many renewals per year does the site need?
Answer
It's renewed after about 31 days of use, so about 365 ÷ 31 ≈ 12 renewals a year. That's why the shorter lifetimes require automation.
6. You find a certificate for your domain in a CT log that you didn't request. What does that tell you, and what should you do?
Answer
A CA issued a certificate for your name to someone. It might be legitimate (another team, a CDN (content delivery network) or hosting provider acting for you) or mis-issuance or an attack. Check with the issuing CA and your providers; if it's unauthorized, ask the CA to revoke it and report it to the root programs. Tools that monitor CT logs can alert you automatically. CAA DNS records can also restrict which CAs may issue for your domain.
Previous: Cryptography for Networking: Ciphers, Key Exchange, Hashes, MACs and Post-Quantum Keys

More in TCP/IP Course
Quiz: TCP/IP Delicate Details
Twenty-five questions on the details that catch out experienced engineers: sequence numbers for SYN and FIN, TIME_WAIT versus tcp_fin_timeout, Karn's algorithm, socket buffer doubling, even and odd ephemeral ports, IPv6 checksums and fragmentation, negative DNS caching, and capture filter traps.
Quiz: TCP/IP Interview Questions
Thirty-three networking questions of the kind asked in developer, SRE and network engineering interviews: what happens when you load a URL, TCP versus UDP, handshakes, closing and TIME_WAIT, subnetting, NAT, DNS, MTU problems, congestion, TLS and QUIC, and debugging slow or failing connections.
Quiz: TCP/IP Course Final Exam (All Parts)
The final exam for the TCP/IP course: thirty questions across all fourteen parts, from packets and addressing through Ethernet, ARP, IP, DHCP, NAT, ICMP, UDP, DNS, TCP connections, reliability, congestion control, security, QUIC and troubleshooting.
Quiz: Modern Transports and Troubleshooting (TCP/IP Part 14)
Review modern transports and troubleshooting: QUIC packets, handshakes, 0-RTT, streams and connection migration, HTTP/3, Multipath TCP, SCTP multihoming, and a layered method for diagnosing real network faults.
Discussion
Sign in to ask a question or share what you learned.