The Online Certificate Status Protocol (OCSP) stapling, formally known as the TLS Certificate Status Request extension, is a standard for checking the revocation status of X.509 digital certificates. It allows the presenter of a certificate to bear the resource cost involved in providing Online Certificate Status Protocol (OCSP) responses by appending ("stapling") a time-stamped OCSP response signed by the CA to the initial TLS handshake, eliminating the need for clients to contact the CA, with the aim of improving both security and performance.
The original OCSP implementation has a number of issues.
Firstly, it can introduce a significant cost for the certificate authorities (CA) because it requires them to provide responses to every client of a given certificate in real time. For example, when a certificate is issued to a high traffic website, the servers of CAs are likely to be hit by enormous volumes of OCSP requests querying the validity of the certificate.
Also, OCSP checking potentially impairs users' privacy and slows down browsing, since it requires the client to contact a third party (the CA) to confirm the validity of each certificate that it encounters.
Moreover, if the client fails to connect to the CA for an OCSP response, then it is forced to decide between: (a) continuing the connection anyway; defeating the purpose of OCSP or (b) terminating the connection based on the assumption that there is an attack; but which could result in excessive false warnings and blocks.
OCSP stapling resolves both problems in a fashion reminiscent of the Kerberos ticket. In a stapling scenario, the certificate holder itself queries the OCSP server at regular intervals, obtaining a signed time-stamped OCSP response. When the site's visitors attempt to connect to the site, this response is included ("stapled") with the TLS/SSL handshake via the Certificate Status Request extension response (note: the TLS client must explicitly include a Certificate Status Request extension in its ClientHello TLS/SSL handshake message).
While it may appear that allowing the site operator to control verification responses would allow a fraudulent site to issue false verification for a revoked certificate, the stapled responses can't be forged as they need to be directly signed by the certificate authority, not the server. If the client does not receive a stapled response, it will just contact the OCSP server by itself. However, if the client receives an invalid stapled response, it will abort the connection. The only increased risk of OCSP stapling is that the notification of revocation for a certificate may be delayed until the last-signed OCSP response expires.
As a result, clients continue to have verifiable assurance from the certificate authority that the certificate is presently valid (or was quite recently), but no longer need to individually contact the OCSP server. This means that the brunt of the resource burden is now placed back on the certificate holder. It also means that the client software no longer needs to disclose users' browsing habits to any third party.
Overall performance is also improved: When the client fetches the OCSP response directly from the CA, it usually involves the lookup of the domain name of the CA's OCSP server in the DNS as well as establishing a connection to the OCSP server. When OCSP stapling is used, the certificate status information is delivered to the client through an already established channel, reducing overhead and improving performance.
The TLS Certificate Status Request extension is specified in RFC 6066, Section 8.
RFC 6961 defines a Multiple Certificate Status Request extension, which allows a server to send multiple OCSP responses in the TLS handshake.
A draft proposal for an X509v3 extension field, which expired in April 2013, specified that a compliant server presenting a certificate carrying the extension must return a valid OCSP token in its response if the status_request extension is specified in the TLS client hello. The current version of the proposal has been extended to support additional TLS extensions. TLS developer Adam Langley discussed the extension in an April 2014 article following the repair of the Heartbleed OpenSSL bug.
Apache HTTP Server supports OCSP stapling since version 2.3.3, the nginx web server since version 1.3.7, LiteSpeed Web Server since version 4.2.4, Microsoft's IIS since Windows Server 2008, HAProxy since version 1.5.0, F5 Networks BIG-IP since version 11.6.0, KEMP LoadMasters since Version 22.214.171.124, and lighttpd since version 1.4.56.
While many web servers advertise support for OCSP stapling, implementations are not always reliable. For example, when Apache queries the OCSP server, in the event of a temporary failure, it will discard the cached good response from the previous request, and start serving bad response. Nginx is lazy loading OCSP responses, which means that for the first few web requests it is unable to add the OCSP response.
OCSP stapling is designed to reduce the cost of an OCSP validation, both for the client and the OCSP responder, especially for large sites serving many simultaneous users. However, OCSP stapling supports only one OCSP response at a time, which is insufficient for certificate chains with intermediate CA certs.
- Eastlake, D. (January 2011). "Transport Layer Security (TLS) Extensions: Extension Definitions: Certificate Status Request". Internet Engineering Task Force (IETF). Retrieved March 2, 2015.
- A., Jesin (June 12, 2014). "How To Configure OCSP Stapling on Apache and Nginx". Community Tutorials. Digital Ocean, Inc. Retrieved March 2, 2015.
- Note: With Microsoft CA and OCSP service (for example the type used as part of a typical Active Directory Domain) the OCSP service does not have to check back with the CA each time it wants to check the status of a certificate (thereby reducing the load in the CA). The OCSP service (generally running on a separate server to the CA) references the CRL (certificate revocation list) which is published typically once per week by the CA (schedule can be changed) and uses this as its source of information for checking the status of certificates.
- Keeler, David (July 29, 2013). "OCSP Stapling in Firefox". Mozilla Security Blog. Mozilla Foundation. Retrieved March 2, 2015.
- Prince, Matthew (October 29, 2012). "OCSP Stapling: How CloudFlare Just Made SSL 30% Faster". CloudFlare, Inc. Retrieved March 2, 2015.
- Gibson, Steve. "Security Certificate Revocation Awareness: The case for "OCSP Must-Staple"". Gibson Research Corporation. Retrieved March 2, 2015.
- "OCSP Stapling". GlobalSign Support. GMO GlobalSign Inc. August 1, 2014. Retrieved March 2, 2015.
- P. Hallam-Baker, X.509v3 Extension: OCSP Stapling Required
- P. Hallam-Baker X.509v3 TLS Feature Extension draft-hallambaker-tlsfeature-05
- A. Langley, No, don't enable revocation checking, April 19, 2014.
- Apache HTTP Server mod_ssl documentation - SSLUseStapling directive
- nginx-announce mailing list - nginx-1.3.7
- Release Log - Litespeed Tech. Retrieved 2014-02-07,
- Duncan, Robert. "Microsoft Achieves World Domination (in OCSP Stapling)". Netcraft Ltd. Retrieved 28 April 2014.
- HAProxy website
- Release Note: BIG-IP LTM and TMOS 11.6.0
- "lighttpd 1.4.56 release info". redmine.lighttpd.net.
- The Problem with OCSP Stapling
- Apache OCSP bug
- Nginx OCSP bug
- Improving Revocation - MozillaWiki, retrieved 2014-04-28
- "How Certificate Revocation Works". TechNet. Microsoft. 16 March 2012. Retrieved 28 April 2014.
- "Issue 361820: Check For Server Certificate Revocation checkbox is confusing". Google Code. 10 April 2014.
- The smtp transport, retrieved 2015-01-24
- Main configuration, retrieved 2015-01-24
- Mozilla NSS Bug 360420, Comment by Adam Langley
- Mozilla NSS Bug 611836 - Implement multiple OCSP stapling extension
- Pettersen, Yngve N. (June 2013). "The Transport Layer Security (TLS) Multiple Certificate Status Request Extension". Internet Engineering Task Force. Retrieved 31 October 2014.