Chapter 7. Securing connections by using OCSP
Online Certificate Status Protocol (OCSP) is a technology that allows web browsers and web servers to communicate over a secured connection. The encrypted data is sent from one side and decrypted by the other side before processing. The web browser and the web server both encrypt and decrypt the data.
7.1. Online Certificate Status Protocol Copy linkLink copied to clipboard!
When a web browser and a web server communicate over a secured connection, the server presents a set of credentials in the form of a certificate. The browser then validates the certificate and sends a request for certificate status information. The server responds with a certificate status of current, expired, or unknown.
The certificate contains the following types of information:
- Syntax for communication
- Control information such as start time, end time, and address information to access an Online Certificate Status Protocol (OCSP) responder.
The web server uses an OCSP responder to check the certificate status. You can configure the web server to use the OCSP responder that is listed in the certificate or another OCSP responder. OCSP allows a grace period for expired certificates, which allows access to a server for a limited time before renewing the certificate.
OCSP overcomes limitations of the older Certificate Revocation List (CRL) method.
7.2. Configuring the Apache HTTP Server for SSL connections Copy linkLink copied to clipboard!
You can configure the Apache HTTP Server to support SSL connections, by installing the mod_ssl package and specifying configuration settings in the ssl.conf file.
Prerequisites
- You have generated an SSL certificate and private key.
- You know the location of the SSL certificate and private key file.
- You have obtained the Common Name (CN) that is associated with the SSL certificate.
Procedure
To install
mod_ssl, enter the following command:yum install jbcs-httpd24-mod_ssl
# yum install jbcs-httpd24-mod_sslCopy to Clipboard Copied! Toggle word wrap Toggle overflow To specify SSL configuration settings:
-
Open the
JBCS_HOME/httpd/conf.d/ssl.conffile. Enter details for the
ServerName,SSLCertificateFile, andSSLCertificateKeyFile.For example:
<VirtualHost _default_:443> ServerName www.example.com:443 SSLCertificateFile /opt/rh/jbcs-httpd24/root/etc/pki/tls/certs/localhost.crt SSLCertificateKeyFile /opt/rh/jbcs-httpd24/root/etc/pki/tls/private/localhost.key
<VirtualHost _default_:443> ServerName www.example.com:443 SSLCertificateFile /opt/rh/jbcs-httpd24/root/etc/pki/tls/certs/localhost.crt SSLCertificateKeyFile /opt/rh/jbcs-httpd24/root/etc/pki/tls/private/localhost.keyCopy to Clipboard Copied! Toggle word wrap Toggle overflow Note-
The
ServerNamemust match the Common Name (CN) that is associated with the SSL certificate. If theServerNamedoes not match the CN, client browsers display domain name mismatch errors. -
The
SSLCertificateFilespecifies the path to the SSL certificate file. -
The
SSLCertificateKeyFilespecifies the path to the private key file that is associated with the SSL certificate.
-
The
-
Open the
-
Verify that the
Listendirective matches the hostname or IP address for thehttpdservice for your deployment. To restart the Apache HTTP Server, enter the following command:
service jbcs-httpd24-httpd restart
# service jbcs-httpd24-httpd restartCopy to Clipboard Copied! Toggle word wrap Toggle overflow
7.3. Using OCSP with the Apache HTTP Server Copy linkLink copied to clipboard!
You can use the Online Certificate Status Protocol (OCSP) for secure connections with the Apache HTTP Server.
Prerequisites
Procedure
Configure a certificate authority.
NoteEnsure that your CA can issue OCSP certificates. The CA must be able to append the following attributes to the certificate:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow In the preceding example, replace
HOSTandPORTwith the details of the OCSP responder that you will configure.- Configure an OCSP responder.
7.4. Configuring the Apache HTTP Server to validate OCSP certificates Copy linkLink copied to clipboard!
You can configure the Apache HTTP Server to validate OCSP certificates, by defining OCSP settings in the ssl_conf file.
Prerequisites
- You have configured a Certificate Authority (CA).
- You have configured an OCSP Responder.
Procedure
-
Open the
JBCS_HOME/httpd/conf.d/ssl.conffile. Specify the appropriate OCSP configuration details for your deployment.
For example:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteThe preceding example shows how to enable OCSP validation of client certificates. In the preceding example, replace
<HOST>and<PORT>with the IP address and port of the default OCSP Responder.
7.5. Verifying the OCSP configuration for the Apache HTTP Server Copy linkLink copied to clipboard!
You can use the OpenSSL command-line tool to verify the OCSP configuration for the Apache HTTP Server.
Procedure
On the command line, enter the
opensslcommand in the following format:openssl ocsp -issuer cacert.crt -cert client.cert -url http://HOST:PORT -CA ocsp_ca.cert -VAfile ocsp.cert
# openssl ocsp -issuer cacert.crt -cert client.cert -url http://HOST:PORT -CA ocsp_ca.cert -VAfile ocsp.certCopy to Clipboard Copied! Toggle word wrap Toggle overflow In the preceding command, ensure that you specify the following details:
-
Use the
-issueroption to specify the CA certificate. -
Use the
-certoption to specify the client certificate that you want to verify. -
Use the
-urloption to specify the HTTP server validating Certificate (OCSP). -
Use the
-CAoption to specify the CA certificate for verifying the Apache HTTP Server server certificate. -
Use the
-VAfileoption to specify the OCSP responder certificate.
-
Use the
Revised on 2025-08-21 16:40:47 UTC