Skip to content

OCSP Must-Staple — what it actually does, what it breaks, and when to deploy it

Reference and decision guide for OCSP Must-Staple: the certificate extension, the stapling pipeline, the failure modes that take a site offline, and the operating posture required to use it safely.

A team enables OCSP Must-Staple on their certificate because it sounds like a security hardening win, the certificate renews three months later, the renewal hook fails to refresh the stapled response, and ninety minutes later every browser in the world refuses to load the site because the served stapled response is now stale. This article is the operational reference for OCSP Must-Staple — what the extension actually says to the browser, what the operational dependencies are, and the posture required to deploy it without occasionally locking yourself out of your own front door.

How to verify

# Check whether a certificate carries the Must-Staple extension (TLS Feature OID 1.3.6.1.5.5.7.1.24)
openssl x509 -in /etc/letsencrypt/live/example.com/cert.pem -text -noout | \
  grep -A2 'TLS Feature'

# Verify the server is actually stapling
echo | openssl s_client -connect example.com:443 -status -servername example.com 2>/dev/null | \
  grep -A 20 'OCSP response'

# Check stapled response freshness from a remote host
echo | openssl s_client -connect example.com:443 -status -servername example.com 2>/dev/null | \
  awk '/This Update|Next Update/ {print}'

# Inspect Nginx's stapling state
nginx -V 2>&1 | grep -o 'http_ssl_module' && \
  echo "OCSP status:" && \
  curl -s http://127.0.0.1/stub_status 2>/dev/null || \
  grep -E 'OCSP|stapling' /var/log/nginx/error.log | tail -20

The TLS Feature extension in the cert is the Must-Staple marker. If the stapled response is missing or its Next Update time has passed, browsers that honor Must-Staple will hard-fail.

What’s happening

OCSP (Online Certificate Status Protocol) is a way for a client to check whether a certificate has been revoked. The naive flow is the browser asks the issuing CA’s OCSP responder for the status of a certificate when it sees one. This has two problems: it leaks browsing history to the CA, and it adds an RTT to every TLS handshake.

OCSP stapling moves that lookup server-side: the web server periodically asks the CA’s responder for a signed OCSP response, attaches that response to the TLS handshake in the status_request extension, and the browser trusts the stapled response instead of asking the CA itself. Stapled responses are valid for a window (often 7 days for Let’s Encrypt) and include thisUpdate and nextUpdate timestamps.

OCSP Must-Staple is a certificate extension (TLS Feature, OID 1.3.6.1.5.5.7.1.24, value status_request) that tells compliant browsers: “If you see this certificate without a stapled OCSP response in the handshake, refuse the connection.” It closes the soft-fail loophole that lets revocation checks fail silently on most browsers. The trade is that the server now has a hard dependency on its OCSP refresh pipeline working — if the staple ever falls behind, the site goes down for those browsers.

What this means in practice:

  • Browsers that enforce Must-Staple (currently Firefox; Chrome enforces less strictly) will refuse the connection if the stapled response is missing or expired.
  • The server’s OCSP refresh logic must run reliably more often than the staple expires, with no quiet failure mode.
  • A failed OCSP fetch must surface as a high-severity alert, not a log line.

The procedure

  1. Audit the renewal hook first. Before enabling Must-Staple, verify the existing OCSP refresh is reliable for at least 60 days of stable operation. Nginx’s built-in ssl_stapling on; ssl_stapling_verify on; fetches lazily on the first request after start; this is unreliable for Must-Staple. Use a separate refresh job that prefetches and verifies the staple file:

    # /etc/cron.hourly/ocsp-refresh
    #!/bin/bash
    set -euo pipefail
    CERT=/etc/letsencrypt/live/example.com/cert.pem
    CHAIN=/etc/letsencrypt/live/example.com/chain.pem
    OUT=/etc/nginx/ocsp/example.com.staple
    URL=$(openssl x509 -noout -ocsp_uri -in "$CERT")
    HOST=$(echo "$URL" | awk -F/ '{print $3}')
    openssl ocsp -no_nonce -respout "$OUT.new" \
      -issuer "$CHAIN" -cert "$CERT" -url "$URL" \
      -header Host="$HOST" -CAfile "$CHAIN" -verify_other "$CHAIN"
    mv "$OUT.new" "$OUT"
    nginx -s reload
  2. Configure Nginx to use the prefetched file. This removes Nginx’s lazy fetch from the critical path:

    ssl_stapling on;
    ssl_stapling_verify on;
    ssl_stapling_file /etc/nginx/ocsp/example.com.staple;
    ssl_trusted_certificate /etc/letsencrypt/live/example.com/chain.pem;
    resolver 1.1.1.1 9.9.9.9 valid=300s;
    resolver_timeout 5s;
  3. Monitor staple freshness explicitly. A staple that hasn’t been refreshed in 6 days is a P1 — you have 24h to fix it before browsers start hard-failing:

    # /usr/local/bin/check-staple-freshness.sh
    STAPLE=/etc/nginx/ocsp/example.com.staple
    NEXT=$(openssl ocsp -respin "$STAPLE" -noverify 2>/dev/null | \
      awk -F': ' '/Next Update/ {print $2}')
    NEXT_SEC=$(date -d "$NEXT" +%s)
    NOW=$(date +%s)
    REMAINING=$(( (NEXT_SEC - NOW) / 3600 ))
    if [ "$REMAINING" -lt 24 ]; then
      echo "CRIT: OCSP staple expires in ${REMAINING}h"
      exit 2
    fi

    Run this hourly from monitoring. A failure here is a real outage in waiting.

  4. Request a certificate with the Must-Staple extension. With certbot, add --must-staple:

    certbot certonly --webroot -w /var/www/example.com \
      -d example.com -d www.example.com \
      --must-staple --rsa-key-size 4096

    For ACME clients other than certbot, set the mustStaple flag in the order request.

  5. Test from a clean browser before claiming success. Open Firefox and visit the site. If you see SEC_ERROR_OCSP_INVALID_SIGNING_CERT or a hard-fail page, the staple isn’t being served correctly. Roll back the Must-Staple flag from the certificate (issue a new cert without it) before users hit the issue.

Operational notes

  • Renewal must preserve the Must-Staple flag. Many automation tools re-request without the flag if the renewal config isn’t sticky. Verify post-renewal with the openssl x509 -text command above.
  • The OCSP responder is part of your dependency graph. Let’s Encrypt’s OCSP responder has had outages; during one, sites with Must-Staple risk going dark for their full staple-expiry window if their stored response expires during the responder outage. Cache a fresh staple before each suspected responder issue and consider serving an extended staple if you can refresh it manually during the incident.
  • Must-Staple is per certificate, not per server. You cannot “turn off” Must-Staple without reissuing the certificate. The flag is baked in and signed by the CA.
  • Long-lived browsers and intermediates matter. A browser that has cached the cert and ignores the staple extension may still load the site; this is not “Must-Staple working.” Test with a cleared profile.
  • The cost of failure is asymmetric. A successful Must-Staple deployment makes the site marginally safer against undetected revocation; a failed staple refresh takes it completely down for Firefox users. Treat the refresh pipeline like a tier-zero dependency, not a cron job.

Stack Harbor runs the refresh pipeline, the freshness monitor, and the staple-warming script for every customer certificate, so a CA responder hiccup or a renewal hook regression is caught hours before any user notices. See our managed operations service for how the certificate operations layer fits with the rest of the platform care.