Install Secure Sockets Layer Certificate through Secure Shell (SSH)

In this tutorial, we will be using the OpenSSL library.

OpenSSL is a robust, commercial-grade, and full-featured toolkit for the Transport Layer Security (TLS) and Secure Sockets Layer (SSL) protocols. It is also a general-purpose cryptography library.

openssl – Used to call the library.
For Node.JS you can install OpenSSL with the below command line…

npm install openssl

Step 1.) Log in to the server through SSH from your computer.

  • Mac OSX – ‘Terminal’.
  • Windows – ‘Putty‘.

Step 2.) Create a .KEY & .CSR certificate

openssl req -nodes -newkey rsa:2048 -keyout -out systemctrl.csr<br />

openssl req -nodes -newkey rsa:2048 -keyout ssl/server.key -out ssl/ -subj "/C=NV/ST=Nevada/L=Las Vegas/<br />

Let’s break down each tag.

req – The req command primarily creates and processes certificate requests in PKCS#10 format. It can additionally create self-signed certificates for use as root CAs for example.
-nodes – If this option is specified then if a private key is created it will not be encrypted.

-newkey – option. The smallest accepted key size is 512 bits. If no key size is specified then 2048 bits is used.

-keyout – This is the default filename to write a private key to. If not specified the key is written to standard output.

-out – This specifies the output filename to write to or standard output by default.

-subj – Prints out the request subject (or certificate subject if -x509 is specified)

C= Country Name (2 letter code)

ST= State Name

L= Locality Name (City)

O= Organizational Unit Name (Legal Name of Business)

CN= Common Name (Website URL)



Leave a Reply

Your email address will not be published. Required fields are marked *