OCSP Stapling
OCSP stapling lets the server attach a signed, time-boxed certificate status proof to the TLS handshake, removing the client-side revocation lookup and its privacy and latency costs.
Definition
OCSP stapling is a TLS extension in which the server fetches its own OCSP response from the certificate authority and staples it into the handshake. The client verifies the signed response instead of querying the CA directly, improving privacy, reducing handshake latency, and avoiding soft-fail revocation checks.
Context and scope
Enabled on web servers and CDNs that present certificates to browsers. The must-staple certificate extension can require it, and CT-stapled responses extend the idea with SCT inclusion proofs.
Common misconceptions
- Stapling revokes certificates — it only distributes revocation state; an expired staple can still leave status unknown
- Stapled responses never expire — each response has a validity window and stale staples must be refreshed
- Clients staple — the server performs the fetching and the client performs the verification
Anti-patterns
- Enabling stapling without an automated refresher, serving expired staples that clients must soft-fail on
- Relying on soft-fail revocation checks as if they caught revoked certificates in practice
- Stapling a response for the leaf while the chain contains intermediates with no status proof
Related concepts
Related examples
Authoritative source
What it is
Classic revocation asks the browser to query the CA mid-handshake or after it, adding a round trip and telling the CA which sites the user visits. Stapling inverts the flow: the server periodically fetches the signed status and presents it with the certificate. The client validates the signature and timestamps locally.
How it works
The server requests an OCSP response for its leaf certificate, caches it until near expiry, and includes it in the CertificateStatus handshake message. Multiple staple extension allows responses for intermediates too. A must-staple TLS feature flag in the certificate obliges clients to hard-fail when the staple is missing.
When to use it
Any public HTTPS endpoint benefits: handshake latency drops, CA query volume drops, and privacy improves. CDNs staple at the edge per certificate. Combine with short-lived certificates and automation so stapling never serves expired proofs.
Pitfalls
If the refresher breaks, servers serve stale or absent staples and browsers fall back to soft-fail, which treats unknown as valid. Some client stacks quietly ignore stapled data. Alert on staple age and refresh failures rather than trusting the handshake to self-report.