Showing posts with label Apache SSL. Show all posts
Showing posts with label Apache SSL. Show all posts

Sunday, July 22, 2007

Generate a Certificate Signing Request (CSR)

Before you purchase an SSL Certificate, you need to generate a Certificate Signing Request (CSR) for the server where the certificate will be installed. Select CSR generation instructions for your server software. If your server is not listed or you need additional information, refer to your server documentation or contact your server vendor. If you do not know what software your server uses, contact your technical support.

Instructions for Financial Certificates

If you plan to purchase a Financial or OFX Certificate, follow instructions from supported vendors:

Instructions for Apache Certificates

CSR Generation Instructions- Apache mod_SSL

To generate a CSR, you will need to create a key pair for your server. These two items are a digital certificate key pair and cannot be separated. If you lose your public/private key file or your password and generate a new one, your SSL Certificate will no longer match. You will have to request a new SSL Certificate and may be charged.

VeriSign recommends that you contact the Apache mod_SSL vendor for additional information.


Step 1: Generate a Key Pair

The utility "openssl" is used to generate the key and CSR. This utility comes with the OpenSSL package and is usually installed under /usr/local/ssl/bin. If you have installed them elsewhere you will need to adjust these instructions appropriately.

Type the following command at the prompt:

openssl genrsa –des3 –out www.mydomain.com.key 1024


image

This command generates a 1024 bit RSA private key and stores it in the file www.mydomain.com.key. When prompted for a pass phrase: enter a secure password and remember it, as this pass phrase is what protects the private key. Both the private key and the certificate are required to enable SSL.

Note: To bypass the pass phrase requirement, omit the -des3 option when generating the private key. If you leave the private key unprotected, VeriSign recommends access to the server be restricted so that only authorized server administrators can access or read the private key file.

Step 2: Generate the CSR

Type the following command at the prompt:

openssl req –new –key www.mydomain.com.key –out www.mydomain.com.csr

image

This command will prompt for the following X.509 attributes of the certificate:

Country Name: Use the two-letter code without punctuation for country, for example: US or CA.

State or Province: Spell out the state completely; do not abbreviate the state or province name, for example: California

Locality or City: The Locality field is the city or town name, for example: Berkeley.

Company: If your company or department has an &, @, or any other symbol using the shift key in its name, you must spell out the symbol or omit it to enroll.

Example: XYZ Corporation

Organizational Unit: This field is optional; but can be used to help identify certificates registered to an organization. The Organizational Unit (OU) field is the name of the department or organization unit making the request. To skip the OU field, press Enter on your keyboard.

Common Name: The Common Name is the Host + Domain Name. It looks like "www.company.com" or "company.com".

VeriSign certificates can only be used on Web servers using the Common Name specified during enrollment. For example, a certificate for the domain "domain.com" will receive a warning if accessing a site named "www.domain.com" or "secure.domain.com", because "www.domain.com" and "secure.domain.com" are different from "domain.com".

Please do not enter your email address, challenge password or an optional company name when generating the CSR.

A public/private key pair has now been created. The private key (www.mydomain.com.key) is stored locally on the server machine and is used for decryption. The public portion, in the form of a Certificate Signing Request (certrequest.csr), will be for certificate enrollment.

Below is a screenshot of the CSR.


image

To copy and paste the information into the enrollment form, open the file in a text editor such as Notepad or Vi and save it as a .txt file. (NOTE: Do not use Microsoft Word as it may insert extra hidden characters that will alter the contents of the CSR.)

Once the CSR has been created, proceed to Enrollment.

Step 3: Backup your private key

Verisign recommends backing up the .key file and storing of the corresponding pass phrase. A good choice is to create a copy of this file onto a diskette or other removable media. While backing up the private key is not required, having one will be helpful in the instance of server failure.

Contact Information

During the verification process, VeriSign may need to contact your organization. Be sure to provide an email address, phone number, and fax number that will be checked and responded to quickly. These fields are not part of the certificate.



SSL Certificates Installation Instructions- Apache SSL

This document provides instructions for installing SSL Certificates. If you are unable to use these instructions for your server, VeriSign recommends that you contact either the vendor of your software or an organization that supports Apache-SSL.

Step 1: Install CA Certificate

Secure Site

If you are installing a Secure Site Certificate, you need to first install the Secure Site Intermediate CA Certificate.

Secure Site Pro

If you are installing a Secure Site Pro Certificate, you need to first install the Secure Site Pro Intermediate CA Certificate.

  1. Copy the intermediate certificate into text file and name it "intermediate.crt". This file can be placed in the same directory as your SSL Certificate. For example: /usr/local/ssl/cr
    Step 2: Install the SSL Certificate

    Your VeriSign certificate will be sent via email. If the certificate is included as an attachment (Cert.cer), you may use the file. If the certificate is imbedded in the body of the email, copy and paste it into a text file (such as OriginalCert.txt) using Vi or Notepad. Do not use Microsoft Word or other word processing programs that may add characters. Confirm that there are no extra lines or spaces in the file.

  1. To follow the naming convention for Apache, rename the certificate filename with the .crt extension. For example: cert.crt
  2. Copy your Certificate into the directory that you will be using to hold your certificates. In For example: /usr/local/ssl/crt/.

Step 3: Configure the Server

  1. In order to use the key pair, the httpd.conf file will need to be updated.
  2. In the Virtual Host settings for your site locate the httpd.conf file. Verify that you have the following 3 directives within this Virtual Host. Please add them if they are not present:

    SSLCertificateFile /usr/local/ssl/crt/public.crt
    SSLCertificateKeyFile /usr/local/ssl/private/private.key
    SSLCACertificateFile /usr/local/ssl/crt/intermediate.crt

The first directive tells Apache how to find the Certificate File, the second one where the private key is located, and the third line the location of the intermediate certificate.

If you are using a different location and certificate file names than the example above (which most likely you are) you will need to change the path and filename to reflect your server.

Note: Some instances of Apache contain both a httpd.conf and ssl.conf file. Please enter or amend the httpd.conf or the ssl.conf with the above directives. Do not enter both as there will be a conflict and Apache may not start.

  1. Save your httpd.conf file and restart Apache. You can most likely do so by using the apachectl script:

    apachectl stop
    apachectl startssl
  2. You should now be set to start using your VeriSign certificate with your Apache-SSL Server.

Topics