To obtain an SSL certificate, CSR (Certificate Signing Request) must be generated. It is then provided to the CA (Certificate Authority) who is responsible to provide such SSL certificates. Such CSR must be generated on the server. CSR includes and stores information such as Country Name, Organization name, domain name, common name, email address, the public key, etc.
In this context, we shall look into easy steps to generate CSR using openssl in any Linux system.
To begin, we must have to install tools like OpenSSL to generate Certificate Signing Request (CSR). In order to install OpenSSL on Ubuntu 20.04 Linux system, you can run the below command:
$ sudo apt install openssl
To verify if OpenSSL is installed or not, you can run the following command:
$ sudo openssl -a
We can run the following command to generate a CSR and key which will be provided later to trusted CA:
$ sudo openssl req -new -newkey rsa:2048 -nodes -keyout test.com.key -out test.com.csr
After executing the above command, it will ask to provide the details such as Country Name, Organization name, domain name, common name, email address. Also, be sure your legally registered company name must be matched with the details you provide. It will be verified perfectly by the Certificate Authority before issuing the certificate.
Next, you can list and view the contents of the file that you have created with the above commands:
You can check and print the contents of the CSR with the following command:
$ cat test.com.csr
Finally, you can use such a CSR file to apply for SSL certificates from a trusted CA.
This article covers the process of creating a CSR file in any Linyx system which is very necessary before applying for an SSL certificate from a Certificate Authority(CA). In fact, Certificate Signing Request(CSR) is a block encrypted text which is given to Certificate Authority when applying for SSL Certificate. Generation of Certificate Signing Request(CSR) for Secure Sockets Layer(SSL) is common in Linux on various distributions.
CSR is generated on the server, it stores information relating to the organization, domain name, country, a city which is to be included in the certificate. The CSR Certificate can be used on any website whenever it is necessary to encrypt communications. To generate an SSL certificate, CSR certificate has to be generated. To obtain a self-signed SSL Certificate, it is necessary to create CSR, after generating submit it to a certificate authority to acquire an SSL Certificate.