How to generate a Certificate Signing Request (CSR) for Apache SSL certificates

Certificate Signing Request (CSR) Generation Instructions for Apache SSL

Solution

This document provides instructions for generating a Certificate Signing Request on Apache. If these instructions do not work for the server, either the vendor of the software or an organization that supports Apache be contacted.

Step 1: Generate Private Key

The OpenSSL package and is usually installed under /usr/local/ssl/bin.

If the utility was installed elsewhere, these instructions will need to be adjusted accordingly.

Type the following command at the prompt:

openssl genrsa -des3 -out <private key file name>.key 2048

https://knowledge.digicert.com/content/dam/digicertknowledgebase/library/VERISIGN/ALL_OTHER/jmagat/privatekey.PNG

NOTEAll certificates that will expire after October 2013 must have a 2048 bit or more key size.

NOTE: If using Apache on Windows or generating a private key for use with Amazon Web Service, Plesk or cPanel please do not include -des3 as this option is not supported.

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

Step 2: Certificate Signing Request (CSR)

Type the following command at the prompt:

openssl req -new -key <private key file name>.key -out <csr file name>.csr 

NOTE: If using openSSL on Windows, the path to openssl.cnf may need to be specified, such as the following:

openssl req -new -key <private key file name>.key -config “c:\Apache Software Foundation\Apache2.2\conf\openssl.cnf” -out <csr file name>.csr 

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, not CA

Locality or City: The Locality field is the city or town where the organization is headquartered spelled in full. For example: Mountain View, not Mt. View

Company: If the company or department has an &, @, or any other symbol using the shift key in its name, the symbol must be spelled out or omitted, in order to enroll. Example: XY & Z Corporation would be XYZ Corporation or XY and Z 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 the keyboard.

Common Name: The Common Name is the Host + Domain Name. It looks like “www.company.com” or “company.com”. most SSL certificates issued to the www subdomain will also include the base domain as a Subject Alternative Name. please check with your vendor for this.

NOTE: Please do not enter an email address, challenge password or an optional company name when generating the CSR. Those would cause trouble for requesting certificates later.

Once the CSR has been created proceed to enroll for the certificate.  When prompted for the CSR, please open the file with a plain-text editor (Notepad, Vi) and copy/paste the full text of the CSR into the order form.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.