GoGetSSL Logo
SSL CertificatesTrust solutions
Home Wiki CSR / SSL Generation CSR and Private Key Generation Using OpenSSL

CSR and Private Key Generation Using OpenSSL

  • You can generate a Certificate Signing Request (CSR) and a Private Key using OpenSSL on almost any server or operating system. The same process applies to Apache, Node.js, Nginx, and other environments that support OpenSSL.

    You will need terminal access to the server or computer and permission to create files in the working directory.

    • *

      Step 1. Check OpenSSL Installation

      Open your terminal or connect to your server via SSH. Run the following command:

      openssl version

      If OpenSSL is installed, the command will display its version.

      If it is not available, install OpenSSL using your operating system's package manager. OpenSSL is a separate command-line utility and does not need to be installed through npm.

    • *

      Step 2. Generate a Private Key and CSR

      Run the following command:

      RSA keys:

      openssl req -new -newkey rsa:2048 -noenc -keyout example.com.key -out example.com.csr

      ECC keys:

      openssl req -new -newkey ec -pkeyopt ec_paramgen_curve:prime256v1 -noenc -keyout example.com.key -out example.com.csr

      Note: Replace example.com with your domain name.

      This command generates two files:

      • example.com.key — your private key.
      • example.com.csr — your Certificate Signing Request.

      Note: If you are using an older OpenSSL version that does not recognize -noenc, replace it with -nodes.

    • *

      Step 3. Enter the Required Information

      OpenSSL will prompt you to enter the following details:

      FieldDescription
      Country NameYour two-letter country code (e.g., US).
      State or Province NameYour state or province.
      Locality NameYour city.
      Organization NameYour organization's legal name, if applicable.
      Organizational Unit NameYour department, if applicable.
      Common NameThe fully qualified domain name (FQDN) you want to secure, e.g., www.example.com.
      Email AddressA contact email address, if requested.

      For a Wildcard certificate, enter a name such as *.example.com in the Common Name field.

      When prompted for the following additional attributes, leave them blank:

      • A challenge password: Do not enter a password.
      • An optional company name: Leave blank unless specifically required.
    • *

      Step 4. Copy and Submit Your CSR

      After completing the prompts, OpenSSL will save both files in your current directory.

      To display the CSR, run:

      cat example.com.csr

      Copy the entire CSR, including the header and footer:

      -----BEGIN CERTIFICATE REQUEST-----
      Your encoded CSR data
      -----END CERTIFICATE REQUEST-----

      Paste it into the CSR field during your SSL certificate order.

      Important: Keep the Private Key (.key file) secure and do not send it to the Certificate Authority. The -noenc (or -nodes) option creates an unencrypted private key, so make sure access to the file is properly restricted.

Fast Issuance within 3-5 minutes

Get a domain-validated SSL certificate within minutes, with no paperwork and no company details needed. Prove you own the domain by email, DNS or a file on your website.

ACME SSL Automation

No more manual installs or expired certificates: automated SSL renews and installs them on any web server. You set it up once, and every renewal runs by itself.

WHMCS Reseller Plugin

Sell SSL certificates from your own hosting platform with our free WHMCS plugin. Your customers order and manage certificates in your client area. See our partner program.

Money Back 30-day guarantee

Your satisfaction comes first: get a full refund within 30 days of buying any SSL certificate, from any brand. Just contact our support team and we will take care of the rest.

Boost Validation

The Legal Entity Identifier (LEI) is a robust and modern way to verify and identify companies, helping to validate OV SSL certificates

Register LEI for $51.00

Help Center

Installation issues or SSL errors? Our Knowledgebase has clear, step-by-step guides to help you install, fix, and troubleshoot fast

Check Manuals

The trust that never expires

Since 2009, we've delivered web security and trust services worldwide. See why customers keep choosing us. From startups to enterprises, we help businesses of all sizes stay secure and build trust with their audience.

Shopper Approved reviews for GoGetSSL