DEV Community

abhisheks-12
abhisheks-12

Posted on

Adding SSL Certificate to JVM in order to access HTTPS

1. Export Certificate from url.

1) Click on view site information icon.

Image description

2)Click on connection is secure icon .

Image description

3) After that click on Certificate is valid.

4) Now go to certificate and click on details tab.

Image description

5) Click on Copy to File and then okay. After that Certificate Export Wizard will open , now click on Next button.

6) Now select DER encoding and click on next.

Image description

7) Provide file path. Where you want to export and then click on next.

Image description

8) Now click on finish to complete export.

Image description

2. Add certificate to java key store

1) Now rum cmd as administrator.
2) Navigate to java bin folder.

Image description

3) Now Enter following commands on cmd -
keytool -importcert -file <filepath of certificate> -alias <certificate name> -keystore "C:\Program Files\java\jdk-11.0.13\lib\security\cacerts"

4) Example -
keytool -importcert -file C:\Demo\ssl.cer -alias ssl -keystore "C:\Program Files\java\jdk-11.0.13\lib\security\cacerts"

5) Now after entering command it will ask for password and password is changeit.

6)Now restart your JVM.

Top comments (0)