How to create a Self signed SSL Certificate

    Have you ever verified that your site runs in a secured way. Here is a tip, If your sites runs in https then it is found to be secured if not then its time to enable https for your site using a SSL Certificate to keep it secure.

Insecured:

Secured:



In this article we will see how to create a SSL Certificate that will help to keep our site secure.


What is a SSL Certificate:

    SSL stands for Secure Socket Layer. It enables an encrypted way of communication between browsers (Ex: Chrome, Firefox, Safari) and  web servers (Ex: Apache, Nginx, etc.,..). This helps us to secure personal information such as passwords, emails, credit card numbers etc..,. For acheving a secure connection an SSL Certificate is required.

Functions of an SSL Certificate:

    SSL Certificate authenticates the identity of the servers so the users may know that they are not sending their informations to the wrong server.
    SSL Certificate encrypts the data that are being transmitted.

    Securing your application with an SSL certificate is the important thing.

    SSL Certficate can be provided by CA-Certification Authority called trusted certificate. Some of the CA-Certification Authority DigiCert, Symantec, Thawte, etc..,.
    We can also use a self-signed certificate which was totally free.

    OpenSSL is a command line tool that is used for TLS (Transport Layer Security) and SSL (Secure Socket Layer) protocols.

By default openssl package will be installed, If you want to install it manually use the below commands,

For RPM based machines,


For Debian based machines,


Creating a Private key:

Create a private key using the below command,


    The above command generates a 2048 bit RSA private key. After executing the command you will be asked for a pass-phrase.
    If you want to create a key without the pass-phrase you can remove the (-des3) from the command.






Creating a CSR:

    A certificate signing request (CSR) contains information (e.g. common name, organization, country). It also contains the public key that will be included in your certificate and is signed with the corresponding private key. To generate a CSR you need the private key.



    The above command generates a CSR (Certificate Signing Request). which asks details of your organisation.




    If you want to purchase a SSL certificate from a Certificate Authority (CA), you have to provide the CSR to them for generating the certificate.

Creating the Certificate:

Run the below command to create your public certificate which will be valid for 365 days, You need the private key and the CSR to create your certificate.







Done.. You have successfully created a self signed certificate for your domain. Now you can install the certificate on your web server to make your site secure.

Feel free to ask if you have any questions.

Comments

Popular Posts on this blog

Apache Webserver - Installation from source (tar.gz and tar.bz2)

Setting up a Mail server using Roundcube - Part-1 - Centos 7

How to Install LAMP Stack on Linux - Centos 7

Installing Docker-Compose on Ubuntu

Apache Tomcat Installation - Ubuntu - 17.04

Setting up a Mail server using Roundcube - Part-3 - Centos 7

Blog Top Sites

Blog Log