welcome hpws docs hp-ux webservers home contact hp support
hp logo - invent  hp-ux web server suite

Admin Guide for SSL transactions

TABLE OF CONTENTS

Overview Setup - Starting and Stopping the HP-UX Apache-based Web Server in Secure mode - Updating the CRL without restarting the Web Server Configuration - Changes from Previous Releases - Available SSL Crypto algorithms - How to create new certificates? - How to add a PEM Pass Phrase to your server key? - How to remove a PEM Pass Phrase from your server key? - How to create ca-bundle.crt? Troubleshooting Known Bugs Tuning - SSL Cipher Suite - Shared memory support - Custom Log format Legal Notices

OVERVIEW

The HP-UX Apache-based Web Server solution delivers a compelling value to our customers by providing state-of-the art security capabilities. A combination of open source and proprietary solutions are chosen for delivering an integrated security solution. - SSL (Secure Socket Layer) plug-in for Apache web server (Apache/mod_ssl) - SSL implementation toolkit (OpenSSL) {open source} A plug-in called mod_ssl is required for enabling support for HTTPS (Secure HTTP) connections through HP-UX Apache-based Web Server. This module was developed under the open source initiative of www.modssl.org for the 1.3.x series of Apache web server and is developed as a part of the core web server for the 2.x series of Apache web server. Several SSL/TLS protocol implementations are available in the market today. Some are commercial and the others are open source based. HP has chosen OpenSSL, a open source software since it is the most reliable, up-to-date toolkit.

SETUP

Starting and Stopping the HP-UX Apache-based Web Server in Secure mode

HP-UX Apache-based Web Server is running under SSL, it is necessary to completely stop, and then start HP-UX Apache-based Web Server, instead of using /opt/hpws/apache/bin/apachectl restart. Note: You must be root to start/stop the HP-UX Apache-based Web Server. To start the HP-UX Apache-based Web Server with SSL capability: (log in as root) $/opt/hpws/apache/bin/apachectl startssl If you have added a new server key (certificate) which has a PEM encoded pass phrase, you will be prompted to enter it here. To stop the HP-UX Apache-based Web Server with SSL capability: (log in as root) $/opt/hpws/apache/bin/apachectl stop

Updating the CRL without restarting the Web Server

HP-UX Apache-based Web Server supports an option(updatecrl) which allows to update a Certificate Revocation List(CRL) without having to restart the entire Web Server. To update the CRL just run the following command: $/opt/hpws/apache/bin/apachectl updatecrl NOTE: This feature is available on HP-UX Apache-based Web Server 2.0.50 version onwards.

CONFIGURATION

The SSL related configuration information for the HP-UX Apache-based Web Server can be found in /opt/hpws/apache/conf/ssl.conf.

Changes from Previous Releases

Added the following new directives - SSLMaxIOBuffer: Use this directive to configure the SSL IO buffer size Usage: SSLMaxIOBuffer <size in number of bytes> Example: SSLMaxIOBuffer 524288 Default: The default buffer size is 256kb. A value of "0" for the directive sets the size to default size. The maximum value that can be configured is 2GB. NOTE: The value should always be in bytes The following has changed between this release and earlier releases of Apache 2.x. v.2.0.0 to v.2.0.39: SSLLog and SSLLogLevel have been removed. Use Apache directives ErrorLog and LogLevel instead.

Available SSL Crypto algorithms

The HP-UX Apache-based Web Server supports all the crypto algorithms available in OpenSSL, with the exception of the IDEA algorithm. As a result, the following ciphers will not be available : IDEA-CBC-SHA, IDEA-CBC-MD5

How to create new certificates?

You can create new dummy certificates by using the SSL Certificate Generation Utility (mkcert.sh). This script generates private keys, certificate signing requests, and certificates for the CA, server, and client. More information can be found by typing the following command at your command prompt : /opt/hpws/apache/util/mkcert.sh --help By default, there is no SSL PEM Pass Phrase on the dummy server key distributed by HP. A PEM ENCODED Pass Phrase can be added or removed from a server key by following the instructions below:

How to add a PEM Pass Phrase to your server key?

To put back the pass phrase that has been removed from a private key or to add a phase phrase for the first time, from "/opt/hpws/apache/conf/ssl.key/server.key", as root run: /opt/hpws/apache/bin/openssl rsa -des3 -in server.key -out server1.key If necessary, update /opt/hpws/apache/conf/ssl.conf: Replace: SSLCertificateKeyFile /opt/hpws/apache/conf/ssl.key/server.key With: SSLCertificateKeyFile /opt/hpws/apache/conf/ssl.key/server1.key

How to remove a PEM Pass Phrase from your server key?

To remove the pass phrase in the private key that's stored within "/opt/hpws/apache/conf/ssl.key/server.key", as root run: /opt/hpws/apache/bin/openssl rsa -in server.key -out server1.key In /opt/hpws/apache/conf/ssl.conf: Replace: SSLCertificateKeyFile /opt/hpws/apache/conf/ssl.key/server.key With: SSLCertificateKeyFile /opt/hpws/apache/conf/ssl.key/server1.key NOTE FOR WEBMIN: --------------- Webmin can also generate keys, certificates, and certificate requests for the Certificate Authority (CA) and the server using the OpenSSL toolkit. Click on "Generate Certificates" from Webmin's main HP-UX Apache-based Web Server screen.

How to create ca-bundle.crt?

The ca-bundle.crt is required *only* if you're trying to use the Client Authentication feature of mod_ssl, and the client certificates are issued by one or more CA's. There are two methods to generate the ca-bundle.crt. Get the CA certificate(s) from your Certificate Authority. -- OR -- Generate the ca-bundle.crt yourself. The steps to generate the ca-bundle.crt yourself are as below : Requirement : A Netscape browser (version 4.7 or higher) on HP-UX. Steps : 1. Create a Netscape certificate database by invoking a Netscape browser (version 4.7 and above) on your HP-UX box. A Certificate database will be created in your home directory ($HOME/.netscape) 2. Invoke /opt/hpws/apache/bin/certmig to extract the certificates from the Netscape Certificate database. At the command prompt, type the following : /opt/hpws/apache/bin/certmig -E -d $HOME/.netscape 3. Upon entering the above command, you'll be asked the following : "Enter Filename where the certificates are to be extracted :" Enter a temporary filename, ex. /tmp/ca-certs. 4. The next question will be to select the certificates that are to be extracted. Select all the certificates to be extracted. 5. Now, cut-and-paste the following perl program to /tmp/parse.pl. The following perl program parses the output of certmig for the certificates and generates the ca-bundle.crt file. -----------------------START OF PARSE.PL--------------------------------- #!/opt/perl/bin/perl $|++; $openssl="/opt/hpws/apache/bin/openssl"; $inputfile=shift; $outputfile=shift; if ( !$inputfile || !$outputfile ) { print "Usage: parse.pl <certmig_output_filename> \n"; exit 1; } open (INPUT, "<$inputfile") || die "Cannot open $inputfile"; open (OUTPUT, ">$outputfile") || die "Cannot open $outputfile"; close (OUTPUT); $inside_certificate=0; while ( <INPUT> ) { if ( !$inside_certificate && /-----BEGIN CERTIFICATE-----/ ) { $inside_certificate=1; open (OUTPUT, ">${inputfile}.tmp")|| die "Cannot open ${inputfile}.tmp"; } if ( $inside_certificate ) { printf OUTPUT $_; if ( /-----END CERTIFICATE-----/ ) { $inside_certificate = 0; close (OUTPUT); system ("$openssl x509 -text -in ${inputfile}.tmp >> $outputfile"); } } } close (INPUT); -----------------------END OF PARSE.PL--------------------------------- 6. chmod a+x /tmp/parse.pl 7. Run the parse.pl utility to generate the ca-bundle.crt file. [MAKE SURE TO SAVE ANY EXISTING CA-BUNDLE.CRT FILES]. At the command prompt, type the following command : /tmp/parse.pl /tmp/ca-certs /opt/hpws/apache/conf/ssl.crt/ca-bundle.crt 8. You now have a ca-bundle.crt that you can use with HP-UX Apache-based Web Server.

TROUBLESHOOTING

- Need to replace a digitalbadge server certificate ---------------------------------------------------- SOLUTION: https://digitalbadge.hp.com/client/revoke.htm - Need to make HP a trusted Certificate Authority (CA). ---------------------------------------------------------------- SOLUTION: https://digitalbadge.hp.com/DBEC/Server_req/server_apache_SSL.html - Digitalbadge doesn't accept my *.csr file or server certificate requests fail at http://digitalbadge.hp.com/ --------------------------------------------------------------- SOLUTION: Add "NEW" to header and footer -----BEGIN CERTIFICATE REQUEST----- -----END CERTIFICATE REQUEST----- should be: -----BEGIN NEW CERTIFICATE REQUEST----- -----END NEW CERTIFICATE REQUEST-----

KNOWN BUGS

- When HP-UX Apache-based Web Server is running under SSL, it is necessary to completely stop, and then start HP-UX Apache-based Web Server, instead of using /opt/hpws/apache/bin/apachectl restart. - It is recommended to use SHMCB session caching. Other caching mechanisms (DBM and SHMHT) are under development.

TUNING

The following tuning recommendations have already been implemented in the default configuration of HP-UX Apache-based Web Server in the /opt/hpws/apache/conf/ssl.conf file.

SSL Cipher Suite

SSLCipherSuite directive in ssl.conf signifies the Cipher suites available for SSL handshake. Although 3DES algorithm provides strong security, it could slow down the performance of SSL transactions. This is because 3DES is a computationally intensive algorithm, when compared to RC4-128. On the other hand, RC4 is tuned for best performance on HP-UX platforms. To take advantage of the RC4 performance, in the ssl.conf we disable the 3DES since this algorithm is bound to be negotiated first. #SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL SSLCipherSuite !ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL Please note that if the *ALL* is defined in the SSLCipherSuite, it causes some of the browsers to negotiate using the 3DES algorithm. Since most of the browsers today support the RC4-128 algorithm, we try to disable the use of 3DES by deleting the *ALL* keyword from the SSLCipherSuite directive.

Shared memory support

The apr_shm library offers Caching of SSL transactions through shared memory. This is similar to the functionality provided by shmem in the previous release of HP-UX Apache-based Web Server. This module improves the performance of SSL transactions by more than 50-100% by caching non-transient parts of the SSL message body in case of keepalive transactions. To take advantage of this feature, by default the following directive is enabled in ssl.conf. SSLSessionCache shmcb:logs/ssl_scache(512000)

Custom Log format

When mod_ssl is used in HP-UX Apache-based Web Server, additional extensions are provided by mod_ssl for the CustomLog feature of mod_log_config. These CustomLog eXtensions, Ex., ``%{varname}x'' can used to expand variables provided by module, thus helping the debugging / learning more about the connections. Example: CustomLog logs/ssl_request_log \ "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b" Although this offers extended traceability, this type of logging introduces a lot of overhead on the SSL performance. This directive is commented out by default in ssl.conf. Enabling this directive must be done with care, fully understanding the performance implications on SSL transactions. ***************************************************************************