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 the utility was installed elsewhere, these instructions will need to be adjusted accordingly.
In this example, CSR was generated for Apache 2.2.3 running on RHEL 5.8 system.
Generate Certificate Signing Request (CSR)
Generate Private Key
Type the following command at the prompt:
openssl genrsa -des3 -out <private key file name>.key 2048 |
Example:
[root@TestServer ~]# openssl genrsa -des3 -out dbappweb.key 2048 Generating RSA private key, 2048 bit long modulus .+++………………………………………………+++ e is 65537 (0x10001) Enter pass phrase for dbappweb.key: Verifying – Enter pass phrase for dbappweb.key: [root@TestServer ~]# |
When prompted for a pass phrase: enter a secure password and remember it, as this passphrase is what protects the private key. Both the private key and the certificate are required to enable SSL.
NOTE: To bypass the passphrase requirement, omit the -des3 option when generating the private key. If the private key is left unprotected, Symantec recommends access to the server be restricted so that only authorized server administrators can access or read the private key file.
Type the following command at the prompt:
openssl req -new -key <private key file name>.key -out <csr file name>.csr
openssl req -new -key <private key file name>.key -out <csr file name>.csr |
Example:
[root@TestServer ~]# openssl req -new -key dbappweb.key -out dbappweb.csr Enter pass phrase for dbappweb.key: You are about to be asked to enter information that will be incorporated into your certificate request. What you are about to enter is what is called a Distinguished Name or a DN. There are quite a few fields but you can leave some blank For some fields there will be a default value, If you enter ‘.’, the field will be left blank. —– Country Name (2 letter code) [GB]:IN State or Province Name (full name) [Berkshire]:Delhi Locality Name (eg, city) [Newbury]:New Delhi Organization Name (eg, company) [My Company Ltd]: DB APP WEB Organizational Unit Name (eg, section) [ ]: SSL Department Common Name (eg, your name or your server’s hostname) [ ]:www.dbappweb.com Email Address [ ]:Please enter the following ‘extra’ attributes to be sent with your certificate request A challenge password [ ]: An optional company name [ ]: [root@TestServer ~]# |
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. Do not abbreviate. For example: Saint Louis, not St. Louis
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: 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”.
NOTE: Please do not enter an 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 (dbappweb.key) is stored locally on the server machine and is used for decryption. The public portion, in the form of a Certificate Signing Request (dbappweb.csr), will be submitted for certificate enrollment.
Backup the private key
It is recommended to back up the .key file and storing of the corresponding passphrase. A good choice is to create a copy of this file onto a diskette or other removable media. While backing up the CSR is not required, having one will be helpful in the instance of server failure.
Last Updated: Apr 17, 2016