ArticleslgStudy

computer science

OCSP stapling

OCSP stapling is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand OCSP stapling rather than just read about it. In short: Online Certificate Status Protocol stapling (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.

Key takeaways

  • OCSP stapling belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect OCSP stapling to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of OCSP stapling from memory before moving on to harder problems.

Reference excerpt

Online Certificate Status Protocol stapling (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. With OCSP stapling, the presenter appends ("staples") a time-stamped OCSP response signed by the certificate authority (CA) to the initial TLS handshake, eliminating the need for clients to contact the CA. OCSP stapling aims to improve both security and performance.

Motivation The original OCSP implementation has several limitations. Firstly, it imposes a substantial operational cost on certificate authorities (CAs), as they must provide real-time responses to every client querying a certificate's status. 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, which could result in excessive false warnings and blocks. OCSP stapling is aimed at addressing these issues with the original OCSP implementation.

Solution 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.

Specification 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.

Deployment OCSP stapling is widely supported. The OpenSSL project included support in their 0.9.8g release with the assistance of a grant from the Mozilla Foundation. 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 7.2.37.1, 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 the bad response. Nginx performs lazy loading of OCSP responses, which means that for the first few web requests it is unable to add the OCSP response. On the browser side, OCSP stapling was implemented in Firefox 26, in Internet Explorer since Windows Vista, and Google Chrome on Linux, ChromeOS, and Windows since Vista. For SMTP the Exim message transfer agent supports OCSP stapling in both client and server modes.

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with OCSP stapling

Start with the simplest possible case. Write down what OCSP stapling claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to OCSP stapling before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about OCSP stapling ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of OCSP stapling

In research
OCSP stapling appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses OCSP stapling in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
OCSP stapling is common in secondary-school and first-year university syllabi. It links to neighbouring topics Certificate revocation, Cryptographic protocols, Internet Standards, so understanding it makes those chapters shorter.
In everyday life
Look for OCSP stapling outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study OCSP stapling in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what OCSP stapling means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain OCSP stapling out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is OCSP stapling in simple terms?

Online Certificate Status Protocol stapling (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 Onlin…

Why does OCSP stapling matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study OCSP stapling?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on OCSP stapling.

Tags

  • Certificate revocation
  • Cryptographic protocols
  • Internet Standards
  • Internet protocols
  • Transport Layer Security

Keep exploring