Ask a Question

Advanced Search

Solution ID : SO12398

Last Modified : 05/02/2018

Generate CSR for Nginx Server

Solution

Login to the server via your terminal client (ssh).

Generate Private Key and Certificate Signing Request (CSR)

Type the following command at the prompt:

openssl req -new -newkey rsa:2048 -nodes -keyout server.key -out server.csr

This will begin the process of generating Certificate Signing Request (CSR) file used to apply for your SSL Certificate. 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: Mountain View. Do not abbreviate. 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.symantec.com" or "symantec.com".
 
Symantec certificates can only be used on Web servers using the Common Name specified during enrollment. For example, a certificate for the domain "symantec.com" will receive a warning if accessing a site named "secure.symantec.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 (private.key) is stored locally on the server machine and is used for decryption. The public portion, in the form of a Certificate Signing Request (server.csr), will be for certificate enrollment.
 
To copy and paste the information into the enrollment form, open the server.csr file in a text editor such as Notepad or Vi and paste the contact of that file into the enrollment form.