How to generate a CSR code? Print

  • 48

Creating SSL Private Key

Before you generate a CSR you need to create a private key first. All modern SSLs require 2048 bit key. 

$ openssl genrsa -out private.pem 2048

Command above creates a private key without password protection and writes it to private.pem file. To create a password protected key use next command.

$ openssl genrsa -des3 -out private.pem 2048

Generating a CSR

Now we are ready to create a CSR. It is as simple as typing command below into console:

$ openssl req -out -key private.pem -new

To view CSR you just need to open file with text editor (use vim or nano) or use "cat" command to print to your console.

$ cat

External Links

* For more info about using openssl command visit
* OpenSSL man pages

Was this answer helpful?

« Back