Security & SSL

What Is OCSP? SSL Certificate Revocation and How It Works

OCSP is the real-time protocol that lets browsers verify whether an SSL certificate has been revoked before its expiry date.

Detailed view of a padlock securing a metal gate with a chain, emphasizing safety and security.

OCSP (Online Certificate Status Protocol) is the mechanism browsers use to verify in real time whether an SSL certificate is still valid or has been revoked by its issuing authority. Without it, a compromised certificate could keep being trusted until its natural expiry date.

This article explains what SSL certificate revocation is, how OCSP works, its limitations, and why the modern variant — OCSP Stapling — is the recommended practice today.

Why Does SSL Certificate Revocation Exist?

An SSL certificate has an expiry date, but sometimes it needs to be invalidated before that date. The most common reasons include:

  • The associated private key was compromised (stolen or leaked).
  • The domain changed ownership.
  • The certificate was issued by mistake or with incorrect data.
  • The company or website shut down.

Without a revocation mechanism, an attacker with access to the private key could keep presenting the certificate as valid. Revocation is the emergency signal that says "this certificate is no longer trusted."

How OCSP Works Step by Step

OCSP replaced the earlier system known as CRL (Certificate Revocation List), which required downloading full lists of revoked certificates — sometimes several megabytes in size. OCSP makes individual, on-demand queries instead:

  1. The browser receives the server's SSL certificate when initiating an HTTPS connection.
  2. It extracts the OCSP Responder URL (a service run by the Certificate Authority, or CA) from the certificate's Authority Information Access field.
  3. It sends an HTTP request to the OCSP Responder with the certificate's serial number.
  4. The OCSP Responder replies with one of three statuses: good, revoked, or unknown.
  5. If the response is revoked, the browser blocks the connection and shows a security error.

This exchange happens in milliseconds, but it adds latency to every new connection because the browser must contact an external server (the CA's).

Limitations of Traditional OCSP

OCSP solves the problem of large CRL files, but it has its own drawbacks:

  • Extra latency: every new connection triggers an additional query to the CA's servers, which may be on a different continent.
  • Privacy: the CA learns which site each user visits and when, because the browser sends the certificate's serial number.
  • Availability: if the OCSP Responder is unavailable, browsers typically apply a soft-fail policy — they accept the certificate anyway to avoid breaking browsing. This creates a security gap.

OCSP Stapling: The Modern Solution

OCSP Stapling flips the flow: instead of the browser querying the CA, the web server does it periodically and attaches (staples) the signed OCSP response directly into the TLS handshake.

Concrete benefits:

  • No extra latency for users: the response is already included in the TLS handshake.
  • Privacy protected: the CA never learns which user visits which site.
  • Better availability: if the OCSP Responder goes down, the server keeps using the cached response (valid for hours or days).

To enable it in Apache, two directives in the VirtualHost are enough:

SSLUseStapling On
SSLStaplingCache shmcb:/var/run/ocsp(128000)

In Nginx, enable it with ssl_stapling on; and ssl_stapling_verify on;.

OCSP Must-Staple: The Strictest Level

There is a certificate extension called OCSP Must-Staple (TLS Feature: status_request). When a certificate includes it, the browser requires the server to provide the staple on every handshake. If it doesn't, the connection is rejected.

This closes the soft-fail gap, but requires the server to be correctly configured with OCSP Stapling at all times. It is not recommended for sites without active maintenance, but is ideal for high-security environments.

Browse more SSL certificate concepts in our SSL security guide.

Key Takeaways

  • OCSP allows real-time verification of whether an SSL certificate has been revoked, without downloading full lists.
  • Classic OCSP adds latency and exposes user privacy to the CA.
  • OCSP Stapling moves the query to the web server, eliminating extra latency and protecting privacy.
  • OCSP Must-Staple is the strictest option: it forces the server to always deliver the staple or fail the connection.
  • Enabling OCSP Stapling is best practice for any site with meaningful traffic.

If you want your site running to the highest TLS security and speed standards, the team at elenlace.com can audit your SSL configuration and enable OCSP Stapling on your server without service interruption.

FAQ

Is OCSP the same as CRL?

No. CRL (Certificate Revocation List) is a full list of revoked certificates that the browser downloads periodically; it can weigh several megabytes. OCSP makes individual, real-time queries for a single certificate, making it far more efficient.

What happens if the OCSP Responder doesn't respond?

Most browsers apply soft-fail: if they can't get an OCSP response, they accept the certificate anyway to avoid blocking browsing. OCSP Stapling mitigates this risk because the server caches the response locally.

How do I know if my server has OCSP Stapling enabled?

You can check with OpenSSL from the command line: openssl s_client -connect yourdomain.com:443 -status. Look for the OCSP Response Data section in the output. You can also use online tools like SSL Labs, which report stapling status directly.

Does Let's Encrypt support OCSP?

Yes. Let's Encrypt runs its own OCSP Responder and its certificates include the corresponding URL. OCSP Stapling works perfectly with Let's Encrypt certificates — you just need to configure it in your web server.

Prefer it done for you? El Enlace handles hosting and professional web development.

Useful resources

Other providers and guides worth comparing:

← All