Configure HTTPS in Localhost

To configure HTTPS in localhost , follow below steps to install self signed ssl certificate

  1. Use the following command to clone the git repository$ git clone git://git.openssl.org/openssl.git

2.

$ cd openssl

3. Use the following command to generate Key and Certificates

openssl req -x509 -sha256 -nodes -newkey rsa:2048 -days 365 -keyout server.key -out server.crt

4. Enter required fields.

5. Enter common name : localhost

Install SSL Certificate:

To install root SSL certificate in windows 10, use Microsoft Management Console(MMC)

Step 1: Click Start > Run Step 2: Enter MMC to open Microsoft Management Console. Step3: Go to File > Add/Remove Snap-in Step 4: Click Certificates, and select Add Step 5: Select Computer Account, and click Next Step 6: Select Local Computer and click Finish Step 7: Click OK to go back to main MMC console window. Step 8:Double-click Certificates (local computer) to expand its view. Step 9:Right-click Certificates under Trusted Root Certification Authorities and select All Tasks then Import Step 10:Complete the wizard to import the chain certificate. Browse to locate the chain certificate to be imported or localhost.crt file to import Step 11: Select Place all certificates in the following store and select the Trusted Root Certification Authorities store.Click Next; then click Finish to complete the wizard.

Once the “import was successful” then you can locate your installed certificate authority in certificate pane.

Configure Application:

to run application with Https, follow below steps:

  1. Go to application “ssl“ folder. Replace server.key and server.crt with the generated key and certificate

  2. Run application with following command:

.