OCSP Stapling and Firefox Soft-Fail vs. Hard-Fail Checks

This article provides a direct overview of Online Certificate Status Protocol (OCSP) stapling and how the Firefox web browser manages certificate revocation checks. It covers the mechanics of OCSP stapling, why it was created to improve upon traditional certificate verification methods, and the critical operational differences between soft-fail and hard-fail security policies. Finally, it details how Firefox implements these checks by default and how users can configure the browser to enforce stricter security standards.

What is OCSP Stapling?

When you visit a secure website (HTTPS), your browser checks the website's SSL/TLS certificate to ensure it is valid and has not been revoked by the issuing Certificate Authority (CA). Historically, this was done using the Online Certificate Status Protocol (OCSP). In a standard OCSP check, your browser contacts the CA’s server directly to ask if the website's certificate is still trustworthy.

Standard OCSP introduces two major problems:

  • Performance Latency: The browser must pause the connection to the website until the CA responds, slowing down page load times.
  • Privacy Concerns: Because the browser contacts the CA directly, the CA knows which websites the user is visiting and when.

OCSP stapling solves both issues. Instead of the browser contacting the CA, the website's own server regularly queries the CA and obtains a digitally signed, time-stamped OCSP response. When a user connects to the website, the server "staples" this pre-fetched proof of validity directly to the TLS handshake. The browser gets the revocation status immediately without contacting a third party, preserving privacy and speeding up the connection.

Soft-Fail vs. Hard-Fail Explained

When a web server does not use OCSP stapling, the browser must fall back to a traditional OCSP check. However, OCSP servers occasionally go offline, experience high traffic, or get blocked by firewalls. When a browser requests a certificate's status and receives no response, it must make a choice: soft-fail or hard-fail.

Soft-Fail

In a soft-fail scenario, if the OCSP server fails to respond within a specific timeframe, the browser assumes the certificate is still valid and allows the connection to proceed.

  • Pros: Ensures a smooth user experience. Websites will not break simply because a CA's server is experiencing downtime.
  • Cons: Creates a major security loophole. An attacker who has stolen a revoked certificate can intercept the connection and intentionally block the OCSP request, forcing the browser to soft-fail and accept the compromised certificate.

Hard-Fail

In a hard-fail scenario, if the browser cannot reach the OCSP server to verify the certificate's status, it immediately terminates the connection and displays a security error to the user.

  • Pros: Guarantees maximum security. A revoked certificate cannot be used via a manipulation of the network.
  • Cons: Reduces reliability. If a CA's OCSP infrastructure goes down, users are locked out of completely legitimate, safe websites.

How Firefox Handles Certificate Checks

Mozilla Firefox actively uses both OCSP and OCSP stapling, along with its own internal revocation system called CRLite, to verify certificates. How it handles a failed check depends on the certificate type and the user's browser settings.

Default Behavior (Soft-Fail)

By default, Firefox uses a soft-fail policy for standard OCSP checks. If you visit a website that does not use OCSP stapling, Firefox will reach out to the CA. If that request times out or fails, Firefox will allow you to visit the site anyway. Mozilla made this the default because CA servers are historically unreliable, and enforcing a strict hard-fail policy by default would result in too many false-positive error pages for everyday users.

The Exception: OCSP Must-Staple (Hard-Fail)

To bridge the gap between reliability and security, the "OCSP Must-Staple" extension was introduced. Website owners can request that their CA include this flag in their SSL/TLS certificate.

If a certificate contains the Must-Staple extension, it tells Firefox that the web server must provide a stapled OCSP response during the handshake. If Firefox connects to a site with a Must-Staple certificate and the stapled response is missing, Firefox will hard-fail and block the connection. This stops attackers from stripping out the stapled response and forcing a soft-fail.

How to Force Hard-Fail in Firefox

Users who prioritize strict security over convenience can manually configure Firefox to use a hard-fail policy for all OCSP checks, regardless of whether the site uses Must-Staple.

To enable hard-fail in Firefox:

  1. Open Firefox and type about:config into the address bar, then press Enter.
  2. Click "Accept the Risk and Continue."
  3. In the search bar, type security.OCSP.require.
  4. Double-click the preference to change its value from false to true.

With this setting enabled, if Firefox cannot definitively prove a certificate is unrevoked—either through a stapled response or a live OCSP query—it will hard-fail and block access to the website.