Explaining certificate revocation, CRL vs OCSP, and OCSP stapling
Certificate revocation in PKI is needed when a certificate should no longer be trusted, such as if its private key is compromised or the certificate holder’s status changes. CRLs are signed lists of revoked certificate serial numbers published periodically by CAs; clients download these lists on a schedule, which can be large, stale, and raise privacy concerns. OCSP lets clients query the CA or responder in real time about a specific certificate’s status, offering fresher information and smaller responses but exposing clients’ browsing patterns and adding latency. OCSP stapling lets the server cache an OCSP response from the CA and include it in the TLS handshake, improving privacy by preventing direct client queries to the CA and speeding up connections by eliminating extra network round trips. This cache is updated periodically, and the “OCSP Must-Staple” extension can require clients to reject connections without stapled responses, enhancing security. Revocation checking sometimes suffers from “soft-fail” open policies that can weaken trust. Overall, CRL uses a push model with periodic downloads, while OCSP uses per-certificate queries; OCSP stapling blends the benefits of OCSP with better privacy and performance by shifting validation responsibility to servers.
In a public key infrastructure you don't just issue certificates and forget about them. Certificates bind a public key to a subject for a defined period of time, but there are lots of reasons you might want to stop relying on a particular certificate before its not‑after date: the private key was leaked, the subject left the organisation, the CA made an error, and so on. “Revocation” is the process by which the issuing certification authority (CA) publishes the fact that a previously issued certificate should no longer be accepted.
Two standard mechanisms have emerged for distributing revocation information:
-
A certificate revocation list (CRL) is exactly what its name suggests: a periodically issued, signed list of certificate serial numbers that have been revoked by that CA. Clients download the current CRL from a URL embedded in the certificate and check whether the certificate's serial number appears. Because a CRL covers all revocations since the last list, popular CAs' lists can grow to megabytes in size, and there's an inherent freshness trade‑off: if you fetch infrequently your local copy may be stale, but fetching frequently adds overhead. CRLs also don't provide per‑connection liveness; you might be consulting a copy that was generated hours or days ago.
-
The Online Certificate Status Protocol (OCSP) takes a “pull” approach: the client sends a short, signed request to an OCSP responder asking for the status of a specific certificate, identified by serial number, and receives a signed good/revoked/unknown response. The responses are small and can be cached, so OCSP gives you much fresher information without downloading whole lists. The downsides are that it introduces an extra network round trip for each new certificate you validate, and because the client contacts the responder in real time it leaks browsing behaviour to the CA or its delegate. Availability is also a concern, so most browsers “soft‑fail” if the responder is unreachable rather than blocking the connection.
To mitigate the performance and privacy issues of live OCSP checks in HTTPS, the TLS extension known as “OCSP stapling” was defined. With stapling enabled, the server itself periodically queries the OCSP responder for its own certificate, obtains a signed OCSP response, and caches it. During the TLS handshake it "staples" that cached response to its Certificate message. The client can verify the signature and freshness of the stapled response without making its own OCSP query. This removes the extra client‑to‑CA round trip, improves user privacy by keeping the CA out of the connection, and, when combined with the must-staple extension on the certificate, allows clients to fail hard if no valid status is presented. Servers are responsible for refreshing the cached response before its nextUpdate time so that they always staple a current status.