A DevOps Guide to Certificate Revocation: CRL, OCSP, and Why You Need OCSP Stapling

Your server's private key has been compromised. It's the scenario that keeps security engineers and DevOps professionals up at night. You've followed protocol and requested that your Certificate Autho...

Tim Henrich
January 21, 2026
8 min read
36 views

A DevOps Guide to Certificate Revocation: CRL, OCSP, and Why You Need OCSP Stapling

Your server's private key has been compromised. It's the scenario that keeps security engineers and DevOps professionals up at night. You've followed protocol and requested that your Certificate Authority (CA) revoke the associated TLS certificate. But what happens next? How do browsers and clients worldwide learn that the certificate they once trusted is now a security risk?

This is the critical, often misunderstood, role of certificate revocation. An invalid certificate that is still trusted by clients is a gaping security hole, enabling man-in-the-middle attacks and impersonation. Yet, the mechanisms for checking revocation status have a fraught history, plagued by issues of performance, privacy, and reliability.

In this comprehensive guide, we'll dissect the three primary methods of certificate revocation—CRL, OCSP, and OCSP Stapling. We'll explore why the first two are largely broken for the modern web and why the third, combined with modern certificate management practices, is the only robust solution for your infrastructure.

The Old Way: Certificate Revocation Lists (CRL)

The original mechanism for revocation is the Certificate Revocation List (CRL). Conceptually, it's simple: a CA periodically publishes a digitally signed, time-stamped list of serial numbers for every certificate it has revoked.

When a client connects to your server, it can download this list from a URL (the CRL Distribution Point) embedded in the certificate. It then checks if your certificate's serial number is on the list.

Why CRLs Failed on the Public Web

While straightforward, CRLs suffer from crippling practical limitations in the context of the modern internet:

  • Bloat and Latency: As a CA revokes more certificates, the CRL file grows. For major CAs, these lists can swell to many megabytes. A client's first visit to any site secured by that CA would require downloading this massive file, adding significant latency to the initial connection.
  • Update Lag: CRLs are only published periodically (e.g., every 24 hours). If a key is compromised and the certificate is revoked, it could still be trusted by clients for hours until the next CRL is published. This is a dangerous window of exposure.
  • Single Point of Failure: If the CRL Distribution Point is unreachable, the client faces a dilemma. Should it "fail open" and assume the certificate is valid, defeating the purpose of revocation? Or should it "fail closed" and block access to the site, causing a potential outage? Most browsers choose to fail open to preserve user experience, rendering the check ineffective.

Today, CRLs are largely relegated to closed, enterprise PKI environments where network conditions are controlled and client behavior can be strictly enforced. For the public web, they are a legacy technology.

A Step Forward: The Online Certificate Status Protocol (OCSP)

The Online Certificate Status Protocol (OCSP) was designed to solve the problems of CRLs. Instead of downloading a huge list, the client makes a real-time request to a CA-operated server, known as an OCSP Responder. The client sends the serial number of the certificate it wants to check, and the responder sends back a small, signed response: Good, Revoked, or Unknown.

This sounds much better. It eliminates the bloat and provides more timely status updates. However, standard OCSP introduced its own set of severe problems.

The Fatal Flaws of Standard OCSP

  1. Performance Bottleneck: The client must pause the TLS handshake to make a separate, blocking DNS lookup and HTTP request to the CA's OCSP responder. This extra round trip adds noticeable latency to the connection setup, slowing down page load times.
  2. Privacy Leak: Every time a user visits your site, their browser sends a request to your CA's OCSP responder containing your certificate's serial number. This effectively tells the CA which website the user is visiting, creating a massive privacy leak of browsing history.
  3. Reliability Issues: Just like with CRLs, the OCSP responder is a single point of failure. If it's slow or down, the connection stalls. To avoid breaking the internet, browsers implemented a "soft-fail" policy: if a response isn't received within a short timeout, the browser gives up and assumes the certificate is valid. Attackers can exploit this by simply blocking access to the OCSP responder.

Because of these performance, privacy, and reliability concerns, direct OCSP lookups by browsers are not the solution we need.

The Modern Solution: OCSP Stapling

OCSP Stapling (formally known as the TLS Certificate Status Request extension) elegantly solves the problems of both CRL and standard OCSP. The responsibility for checking the certificate's status shifts from the client's browser to your web server.

Here’s how it works:
1. Your web server, at regular intervals, makes a request to the CA's OCSP responder for its own certificate.
2. The OCSP responder provides a signed, time-stamped response.
3. Your server caches this response.
4. When a client connects, your server "staples" this cached OCSP response directly into the TLS handshake.

The client receives the certificate and the proof of its current validity all in one go.

The Benefits of OCSP Stapling

  • Excellent Performance: The client doesn't need to make any extra outbound connections. The TLS handshake proceeds without delay, eliminating the latency of standard OCSP.
  • Preserves Privacy: The client never communicates with the CA. Only your server does, so the user's browsing history is not exposed.
  • Improved Reliability: The server manages the OCSP query. If the CA's responder is temporarily down, your server can continue serving its last known-good stapled response until it expires (typically for 24-72 hours). This shields clients from CA infrastructure issues.
  • High Scalability: Instead of every client hitting the CA, only your web server does, and it can serve the cached response to thousands of clients. This drastically reduces the load on the CA's infrastructure.

How to Implement and Verify OCSP Stapling

Enabling OCSP Stapling is a straightforward configuration change on modern web servers.

NGINX Configuration

In your nginx.conf file, within the relevant server block for your SSL-enabled site, add the following directives:

server {
    listen 443 ssl http2;
    server_name yourdomain.com;

    # SSL Certificate paths
    ssl_certificate /etc/letsencrypt/live/yourdomain.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/yourdomain.com/privkey.pem;

    # OCSP Stapling directives
    ssl_stapling on;
    ssl_stapling_verify on;

    # A resolver is required for the server to look up the CA's OCSP responder
    resolver 8.8.8.8 8.8.4.4 valid=300s;
    resolver_timeout 5s;

    # ... other server settings
}
  • ssl_stapling on;: Enables OCSP Stapling.
  • ssl_stapling_verify on;: Tells NGINX to verify the signature of the OCSP response it receives from the CA.
  • resolver ...;: Specifies DNS resolvers for NGINX to find the OCSP responder's address. This is a critical and often-missed step.

Apache Configuration

In your virtual host configuration file (e.g., /etc/apache2/sites-available/yourdomain-ssl.conf), add this directive inside your <VirtualHost> block:

<VirtualHost *:443>
    ServerName yourdomain.com

    # SSL Certificate paths
    SSLEngine on
    SSLCertificateFile /etc/letsencrypt/live/yourdomain.com/cert.pem
    SSLCertificateKeyFile /etc/letsencrypt/live/yourdomain.com/privkey.pem
    SSLCertificateChainFile /etc/letsencrypt/live/yourdomain.com/chain.pem

    # OCSP Stapling directive
    SSLUseStapling on

    # Define a cache for stapled responses
    SSLStaplingCache "shmcb:/var/run/ocsp(128000)"

    # ... other vhost settings
</VirtualHost>

Verifying Your Configuration

After reloading your web server, you must verify that stapling is working correctly. The easiest way is with the openssl command-line tool:

openssl s_client -connect yourdomain.com:443 -status

In the output, look for the "OCSP Response Data" section. You should see:

OCSP Response Status: successful (0x0)
Cert Status: good

If you see OCSP Response: no response sent, your configuration is incorrect. Common culprits include firewall rules blocking outbound requests from your server or a missing resolver configuration in NGINX. You can also use the Qualys SSL Labs SSL Server Test, which will check for "OCSP stapling" in its report.

The Gold Standard: Short-Lived Certificates + Must-Staple

While OCSP Stapling is a massive improvement, the industry has converged on a two-pronged strategy that represents the current best practice for TLS security.

1. Radically Shorten Certificate Lifetimes

The rise of automation through the ACME protocol, pioneered by Let's Encrypt, has made it trivial to issue and renew certificates with 90-day lifetimes. This fundamentally changes the security equation.

If a private key is compromised, the maximum window of exposure is limited to the remaining life of the certificate. An attacker has, at most, 90 days before the certificate expires and becomes useless. This drastically reduces the urgency and impact of a failed revocation check. Managing this rapid renewal cycle is a core challenge of modern infrastructure, which is why services like Expiring.at are essential for tracking and ensuring no certificate slips through the cracks.

2. Enforce Stapling with must-staple

What if an attacker can perform a man-in-the-middle attack and strip the stapled OCSP response from the TLS handshake? Because browsers typically "soft-fail," they would proceed with the connection, trusting the revoked certificate.

The must-staple extension (formally defined in RFC 7633) solves this. When you request a certificate, you can ask the CA to include this extension. It acts as a flag telling browsers that a valid, stapled OCSP response is mandatory for that certificate.

If a browser connects to a server with a must-staple certificate but does not receive a valid stapled response, it will hard-fail and terminate the connection. This closes the "soft-fail" loophole and makes revocation checks truly reliable.

You can request a must-staple certificate from CAs like Let's Encrypt by adding a specific flag to your ACME client. For example, with Certbot, you would use --must-staple.

Conclusion: Your Action Plan

The landscape of certificate revocation has evolved significantly. Relying on outdated or flawed mechanisms puts your applications and users at risk. Here are your key takeaways:

  1. Stop Relying on CRL and Direct OCSP: These methods are broken for the public internet due to performance, privacy, and reliability issues.
  2. Implement OCSP Stapling Everywhere: It is the single most effective revocation mechanism available. Configure it on all your web servers and verify that it's working correctly.
  3. **

Share This Insight

Related Posts