To enable OCSP Stapling on Apache:
Versions lower than 2.3.3 do not support OCSP stapling, so you should update Apache before proceeding with the rest of this tutorial.
Alternatively, you can check by running the following OpenSSL command:
openssl s_client -connect [my-domain.com]:443 -status
If OCSP is enabled, the OCSP Response Data section should say:
OCSP Response Status: successful (0x0)
If it is not enabled, you won’t see any OCSP Response Data.
DNS HOSTNAME(S) |
Destination IP |
Port |
OCSP.ComodoCA.com |
178.255.83.1 or 2a02:1788:2fd::b2ff:5301 |
Tcp/80 |
To check connectivity, use the following telnet command:
telnet OCSP.ComodoCA.com 80
If the test is successful the reply will state ‘Connected to OCSP.ComodoCA.com’ for at least one of the ‘Destination IP’ addresses in the table above.
If the test is unsuccessful the replies will state ‘Network Unreachable’ and/or ‘Connection Timed Out’. Please make the required network changes to allow your Apache server to connect to our OCSP servers. Once complete, we advise you to re-run the test in step 2 to establish whether OCSP stapling is already enabled.
nano /etc/apache2/sites-available/your-domain.com-ssl.conf
Make the following changes:
SSLUseStapling on
SSLStaplingResponderTimeout 5
SSLStaplingReturnResponderErrors off
SSLCACertificateFile /etc/apache2/ssl/full_chain.pem
SSLStaplingCache shmcb:/var/run/ocsp(128000)
Use the example below as a reference configuration:
<IfModule mod_ssl.c>
SSLStaplingCache shmcb: /var/run/ocsp(128000)
<VirtualHost *:443>
ServerAdmin [email protected]
ServerName your-domain.com
DocumentRoot /var/www
SSLEngine on
SSLUseStapling on
SSLStaplingResponderTimeout 5
SSLStaplingReturnResponderErrors off
SSLCertificateFile /etc/apache2/ssl/your-domain.com/your_certificate.crt
SSLCertificateKeyFile /etc/apache2/ssl/your-domain.com/your.key
SSLCACertificateFile /etc/apache2/ssl/full_chain.pem
</VirtualHost>
</IfModule>