What Is OCSP Stapling or SSL Stapling? – A Detailed Guide

1 Star2 Stars3 Stars4 Stars5 Stars (2 votes, average: 5.00 out of 5)
OCSP Slapling

OCSP stapling renders it more accessible and more rapid for a customer than ever to check the status of an SSL/TLS certificate’s revocation. It is an enhancement over the existing industry standard, OCSP. But what exactly is OCSP stapling, and why does it matter for the security of your website?

When you access a website using a browser, the browser checks the site’s TLS certificate, including the certificate’s signature, validity period, and whether it has been revoked. OCSP (The online certificate status protocol), OCSP stapling, and CRLs (certificate revocation lists) are two techniques for determining the TLS certificate’s revocation status.

In our most recent post, we discussed OCSP and how it may be used for verifying the status of a website certificate’s revocation. However, what distinguishes the OCSP from the CRL?

Recommended: OCSP vs. CRL: What is the Difference?

With OCSP, the client asks the site for its certificate. The issuing CA receives the certificate from the site’s web server and uses its OCSP responder to inform the user of the status of the certificate’s revocation. The user’s browser then receives it from the web server again.

Although it’s a secure solution, it has a few drawbacks. OCSP stapling or SSL stapling was designed to get around some of these limitations.

This article will discuss “what exactly is OCSP stapling (also known as SSL_Stapling / Certificate stapling), it’s working, and its advantages & disadvantages.”

Let’s dive in,

What is OCSP stapling?

An alternate method for determining the validity of an SSL certificate to the original Online Certificate Status Protocol (OCSP) is OCSP stapling. This is accomplished by allowing the webserver to query the OCSP responder—a server that listens for OCSP requests—and then caching its response.

This eliminates the requirement for the client to get in touch with the certificate authority and enables the web server to verify the legitimacy of its certificates.

In RFC 2560 and RFC 5019, OCSP stapling is addressed. The website’s server instantly sends the client trying to connect an updated status. Given that it has been timestamped and signed by the issuing CA, the client could believe it.

Challenges with the Original OCSP

Since each client that requests certificate information must receive a response, the original online certificate status protocol could be more efficient. As a result, when a certificate is granted to an occupied or busy website, the servers of the CA receive a lot of requests requesting information on the certificate’s validity.

This is not ideal since it slows downloading speeds and puts the user at more risk for security breaches because information needs to travel through a third party.

For instance, if a user goes to https://www.sample.com, the certificate’s authenticity must be verified because the website is SSL encrypted. The browser will contact the certificate provider to find out if the certificate is still valid. The user must give the URL the certificate vendor requires for a third party to know who visited which websites and when.

Additionally, suppose the browser is unable to get in contact with the CA for an OCSP reply. In that case, the user is notified with a warning message and provided an option to continue or cancel the connection. As a result, people who worry that their information might not be secure can receive fake warning messages and quit.

OCSP Stapling: How Does It Work?

In contrast to other verification techniques, where it is the client’s responsibility to check if websites’ certificates have been revoked, OCSP stapling rests the burden on the server.

The server shows a client the most recent verification status when they attempt to connect. The CA has the power to choose when to refresh the response. The client can trust the certificate because it was signed by the CA who issued the server certificate. Additionally, a timestamp indicating the creation date and time will be included.

How the OCSP Stapling Procedure Works?

  • The web server approaches the CA on the backend for the most current revocation status due to continuing communication between the two parties.
  • The CA notifies the server of its revocation status by sending signed, timestamped data, which the server caches.
  • A request for connection is sent to the server by the client browser.
  • In response to the client, the server “staples” or annexes the cached data on its revocation status.
  • Client browsers will connect to websites only if the server certificate is valid.
  • The client browser will indicate that the certificate is invalid whenever the server certificate has been revoked.

How to Enable OCSP Stapling on your Server?

Today, most current browsers support OCSP stapling. Follow these instructions to find complete details on how to set up OCSP stapling on your Apache or Nginx server.

How to Enable OCSP Stapling in Nginx?

OCSP stapling Nginx – Nginx 1.6.2 was used to construct these instructions. You should alter these steps by using the Nginx version.

  1. Verify your Nginx version.
  2. From 1.3.7+, Nginx supports OCSP stapling.
  3. Use this command to find out the version of Nginx you are using:
  4. Nginx –v
  5. Verify whether OCSP stapling is enabled.
  6. To the right of OCSP Staple, it states Good if OCSP stapling is enabled under SSL Certificate has not been revoked.
  7. If OCSP stapling is not enabled, it will indicate Not Enabled to the right of OCSP Staple under SSL Certificate Has Not Been Revoked. You must then proceed to verify if the Intermediate Certificate is correctly installed.
  8. Make sure the Intermediate Certificate is installed correctly.
  9.  On your Nginx server, the Intermediate Certificate must be deployed appropriately before you can activate OCSP stapling.
  10. Check the Nginx server’s connection with the OCSP server.
  11. Configure OCSP Stapling on your Nginx server.
  12. When your Nginx server has been verified to support OSCP stapling and to be able to connect to the OCSP server, use the instructions below to activate OCSP stapling on your Nginx server.
  13. The SSL configuration file for your website should be edited.
  14. Inside the “server {}” block, add the following directives:
ssl_stapling on;

ssl_stapling_verify on;
  • Verify that the OCSP stapling is now enabled.
  • To the right of OCSP Staple, it states Good if OCSP stapling is enabled under SSL Certificate has not been revoked.

How to Enable OCSP Stapling in Apache?

OCSP stapling Apache: Apache 2.4.7 was used to generate these instructions. You should alter these instructions by the version of Apache you are using.

  1. Verify your Apache version.
  2. In Apache HTTPD Server 2.3.3 and later, OCSP stapling is supported.
  3. Use one of the listed commands to determine the version of Apache you are using:
apache2 -v

httpd -v
  • Verify that OCSP stapling is turned on.
  • If OCSP stapling is enabled, Good will appear to the right of OCSP Staple under SSL Certificate has not been revoked.
  • If OCSP stapling is not enabled, it will indicate Not Enabled to the right of OCSP Staple under SSL Certificate Has Not Been Revoked. Check to make sure the Intermediate Certificate is correctly installed.
  • Verify that the Intermediate Certificate is installed correctly.
  • The Intermediate Certificate must be correctly deployed on your Apache server before you can activate or activate OCSP stapling.
  • Check the connection between the OCSP server and the Apache server.
  • Make sure that OCSP Stapling is enabled on your Apache server.
  • Use the steps below to turn on OCSP stapling on your Apache server after making sure it can connect to the OCSP server and that OSCP stapling is supported by it.
  • Edit the VirtualHost SSL settings for your website.
  • Within the VirtualHost>/VirtualHost> block, insert the following line:
SSLUseStapling on
  • Outside the VirtualHost>/VirtualHost> block, add the following line:
SSLStaplingCache shmcb:/tmp/stapling_cache(128000)
  • Verify to determine if OCSP stapling is now enabled.
  • If OCSP stapling is enabled, Good will appear to the right of OCSP Staple under SSL Certificate and has not been revoked.

Benefits and Drawbacks of OCSP Stapling:

When checking the revocation status of TLS certificates, OCSP stapling has several benefits, including:

Enhanced Privacy Services for Consumers

The client’s privacy is more secure than conventional OCSP responder inquiries since neither the CA nor the OCSP responder can see the websites the client visits.

Offers Enhanced Performance and Speed

One of the OCSP stapling technique’s most significant benefits is speed. Verifying a TLS certificate’s revocation status only requires a brief period.

Fewer Resources are Needed

OCSP stapling is a more effective technique than CRL or OCSP since it uses fewer network resources for the client.

Now moving towards the Drawbacks:

Presently not Supported by all the Browsers

Not all browsers currently offer support for OCSP Stapling. The validity status query will immediately go back to OCSP, checking with the CA if the browser or web server does not support or has OCSP Stapling enabled.

No Intermediate Certificates were Checked

Sometimes, a certificate chain for TLS has a lot of intermediate CA certificates. OCSP stapling typically only performs revocation status checks on leaf/server certificates, not verification for the intermediate certificates.

Wrap up!

Cybercriminals can easily steal your customers’ sensitive data by visiting websites with expired or revoked TLS certificates and utilizing them for their wicked purposes., OCSP stapling is a mechanism that enables browsers to check if the TLS certificate of a website you want to access has been revoked by offering a real-time revocation status check.

Although OCSP stapling is more straightforward and faster than CRLs and OCSP, not all browsers support it. It is growing in popularity, so you might expect to see it used extensively.


Is OCSP Stapling Necessary?

OCSP Stapling speeds up the SSL handshake connection by merging two requests into one. This reduces the time it takes for an encrypted webpage to load. Since no connection is established to the CRL for the OCSP request, OCSP Stapling protects the end user’s privacy.

What port does OCSP Use?

An industry standard called OCSP is designed to use Port 80. When Snowflake clients attempt to connect to an endpoint using HTTPS, it employs Online Certificate Status Protocol to guarantee the utmost security to check whether a certificate has been revoked.

What is the OCSP must Staple Flag ?

For certificates that keep the status_request Must-Staple flag, OCSP Stapling is accepted by default. Any TLS connection the NATS server accepts during the TLS handshake will be given a new staple once the NATS server requests it from the OCSP responder.

What is the OCSP Stapling Check ?

The verification of certificate data may be handled more effectively with OCSP stapling. OCSP stapling enables the web server to periodically query the OCSP responder and store the response rather than sending a request to the CA’s server for each certificate verification request.

What is OCSP in Cryptography?

An X. 509 digital certificate’s revocation status can potentially be verified through the Online Certificate Status Protocol, an Internet protocol. Along with other out-of-date RFCs, it is described in RFC 6960.

Janki Mehta

Janki Mehta

Janki Mehta is a passionate Cyber-Security Enthusiast who keenly monitors the latest developments in the Web/Cyber Security industry. She puts her knowledge into practice and helps web users by arming them with the necessary security measures to stay safe in the digital world.