OCSP explained: query certificate revocation status and validate the response
The Online Certificate Status Protocol (OCSP) lets a certificate verifier ask an OCSP responder about the status of a specific X.509 certificate. A typical response reports `good`, `revoked`, or `unknown`, along with response-validity times. The verifier must check the response signature, target certificate identifier, responder authority, and freshness. `good` is a positive status with a defined scope; it does not prove the certificate chain, purpose, or account permissions are all valid.
Request and response flow
The verifier builds a status request using the target certificate and issuer information. OCSP CertID includes hashes of the issuer name and public key, plus the target certificate’s serial number.
The requester finds an OCSP responder location in the certificate’s AIA (Authority Information Access) extension or uses a locally configured responder.
The responder may return `good`, `revoked`, or `unknown`, or an error. An error message is not the same as a signed status response, so verifier policy must distinguish them.
The verifier checks the status-response signature and confirms that the signer is the issuing CA or a responder explicitly authorized by that CA.
It checks `thisUpdate`, `nextUpdate`, and `producedAt` to decide whether the response falls within an acceptable time range. If the request uses a nonce, it checks that the response nonce matches.
If the status is `revoked`, reject the certificate. Apply a policy defined in advance for `unknown`, stale responses, signature errors, and connection failures.
Interpreting the three statuses
| Status | Meaning and handling |
|---|---|
good | A positive response that, under RFC 6960, means at minimum that no certificate with the requested serial number currently within its validity interval is revoked. It does not necessarily show that the certificate was ever issued, nor replace other certificate checks. |
revoked | The certificate has been revoked or placed on hold. The response may include the revocation time and an optional reason. The verifier should no longer accept it. |
unknown | The responder cannot determine the requested certificate’s status. Do not treat this as good; according to policy, use a CRL, another responder, or a rejection path. |
A response contains signed status information and validity times. RFC 6960 recommends treating a response as unreliable if nextUpdate is earlier than the current time or thisUpdate is in the future. If nextUpdate is absent, the responder indicates that newer revocation information is available all the time. The acceptable clock skew and cache lifetime depend on system policy and the applicable profile.
Operational design and failure handling
**Responder trust:** Validate not only the response signature, but also the responder certificate and delegation, key usage, and OCSP Signing constraints that apply.
**Freshness:** Set an acceptable response age, synchronize system clocks, and avoid keeping cached responses longer than revocation data can remain stale.
**Privacy and tracking:** If a client directly asks a CA about a particular certificate, its use pattern may be exposed. Consider the connection design and whether a central proxy or cache is used.
**Availability:** Choose fail-open or fail-closed behavior for responder outages and network blocks according to risk. `unknown` and connection errors are not the same as `good`.
**Response replay:** A nonce can be used when a fresh response is required for each request, but nonce handling and pre-produced responses affect interoperability and caching. Check the current nonce specification.
**Alternatives and complements:** Compare CRLs, OCSP caches, and TLS OCSP stapling where supported. Do not assume a product supports a feature; verify actual client behavior.
**Monitoring:** Record response latency, signature failures, stale responses, unknown status, and responder errors. Design alerts that distinguish these from authentication failures.
For example, when a browser checks a web server certificate, a direct request from the client may obtain updated status but depends on responder connectivity. In a configuration that supports TLS OCSP stapling, the server can send a signed status response with the connection, reducing direct client requests to the responder and potentially reducing some privacy exposure. The client must still verify the stapled response’s signature and validity period. This is a general design example, not a test of a particular browser or server.
References
[RFC 6960: Online Certificate Status Protocol](https://www.rfc-editor.org/rfc/rfc6960.html) — status values, request/response, responder authority, and time fields
[RFC 9654: OCSP Nonce Extension](https://www.rfc-editor.org/rfc/rfc9654.html) — updated nonce extension specification
[RFC 6066: TLS Extensions](https://www.rfc-editor.org/rfc/rfc6066.html) — TLS status request and server-provided certificate status response
[RFC 9919: Lightweight OCSP Profile for High-Volume Environments](https://www.rfc-editor.org/rfc/rfc9919.html) — current high-volume OCSP profile