DigiCert KnowledgeBase - Technical Support-hero

Knowledge Base

Generate a Certificate Signing Request (CSR) using OpenSSL on Microsoft Windows system

Solution ID : SO27347
Last Modified : 11/01/2023

Solution

To generate a Certificate Signing Request (CSR) using OpenSSL on Microsoft Windows system, perform the following steps:

Step 1: Install OpenSSL

  1. Open the following link in your web browser: https://wiki.openssl.org/index.php/Binaries
  2. On the table Third Party OpenSSL Related Binary Distributions, there are a few distributions.
  3. Select the "OpenSSL for Windows" and follow the link: https://slproweb.com/products/Win32OpenSSL.html
  4. Scroll to the section “Download Win32 OpenSSL"
  5. Select one of the non-light editions of the installer and download it.
  6. Double click the OpenSSL file using default settings to complete the installation.


Step 2: Set up OpenSSL for usage

  1. In Windows, click Start Run
  2. In the Open box, type CMD and click OK
  3. A command prompt window appears
  4. Type the following command at the prompt and press Enter:
    cd \OpenSSL-Win32
  5. The line changes to C:\OpenSSL-Win32
  6. Type the following command at the prompt and press Enter:
    set OPENSSL_CONF=c:\OpenSSL-Win32\bin\openssl.cfg
  7. Restart computer (mandatory)

Protect your brand and your users with a DigiCert Verified Mark Certificate.


Step 3: Generate a Certificate Signing Request (CSR) using OpenSSL on Windows

  1. In Windows, click Start > Run
  2. In the Open box, type CMD and click OK
  3. A command prompt window appears
  4. Type the following command at the prompt and press Enter:
    cd \OpenSSL-Win32\bin

  5. The line changes to C:\OpenSSL-Win32\bin
  6. Type the following command at the prompt and press Enter:
    openssl genrsa -out private-key.key 2048
  7. Type the following command at the prompt and press Enter:
    openssl req -new -key private-key.key -out csr.txt
  8. Fill in the required fields:
    • 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. 
    • 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.digicert.com" or "digicert.com".
      DigiCert certificates can only be used on Web servers using the Common Name specified during enrollment. For example, a certificate for the domain "digicert.com" will receive a warning if accessing a site named "www.digicert.com" or "secure.digicert.com", because "www.digicert.com" and "secure.digicert.com" are different from "digicert.com.

      Note: Please do not enter an email address, challenge password or an optional company name when generating the CSR.
  9. A public/private key pair has now been created. The private key (i.e. private-key.key) is stored locally on the computer and is used for decryption. The public portion, in the form of a Certificate Signing Request (i.e. csr.txt), will be for certificate enrollment.
  10. To move the private key and CSR file to a centralize directory (e.g. certificate) from local computer. Type the following command at the prompt and press Enter:
    • md c:\certificate
    • move private-key.key c:\certificate
    • move csr.txt c:\certificate
  11. The CSR file (i.e. csr.txt) is now ready to use for certificate enrollment
  12. To open the CSR file using Notepad via command prompt. Type the following command at the prompt and press Enter:
    notepad c:\certificate\csr.txt
  13. A new window (i.e. Notepad) opens which contains the information needed to enroll for a certificate
  14. To copy the Certificate Signing Request from Notepad window, click Edit Select All
  15. Go to Edit again and select Copy
  16. Once the CSR has been copied, proceed to certificate enrollment