Advertisement
Advanced ASP.NET Core, HTTPS, Certificates & Transport Security

How would you configure OCSP stapling or handle certificate revocation checking to ensure a compromised certificate is rejected even if it hasn't yet expired?

Short answer

Certificate revocation checking (via CRL - Certificate Revocation Lists, or the more efficient OCSP - Online Certificate Status Protocol) verifies a certificate hasn't been revoked by its issuing CA before its natural expiration (e.g., due to a private key compromise) -- OCSP…

Save ASP.NET Core mock interview
Advertisement
AModel answer
Certificate revocation checking (via CRL - Certificate Revocation Lists, or the more efficient OCSP - Online Certificate Status Protocol) verifies a certificate hasn't been revoked by its issuing CA before its natural expiration (e.g., due to a private key compromise) -- OCSP stapling has the server periodically fetch and cache its own revocation status from the CA, then include ('staple') that proof directly in the TLS handshake, avoiding the client needing to make its own separate, latency-adding OCSP query to the CA for every connection, which OS-level TLS stacks (schannel, OpenSSL) largely handle automatically as of modern .NET versions, though explicit configuration/monitoring is still a production concern.
# OCSP stapling is largely handled by the underlying OS/TLS library automatically,
# but reverse proxies like nginx can be explicitly configured:
server {
    ssl_stapling on;
    ssl_stapling_verify on;
    ssl_trusted_certificate /etc/ssl/chain.pem;
}
Real-world example
A security team investigating a suspected private key compromise immediately revokes the affected certificate through their CA, relying on OCSP checking (enabled at their nginx reverse proxy layer) to ensure clients reject the compromised certificate promptly rather than continuing to trust it until its natural expiration date months later.
Likely follow-ups
  • What's the performance and reliability trade-off between OCSP stapling and traditional CRL-based revocation checking?
  • What happens to client connections if an OCSP responder itself becomes unreachable ('soft-fail' versus 'hard-fail' behavior)?
Related topics