Trusting A Certificate
How to make JDK trust a Certificate
How to copy a certificate to your disk?
- Hit the HTTPS URL, it would pup up a Security Alert window - that means browser doesn’t trust the certificate that site has.
- Click on View Certificate button on that window.
- Click on Install Certificate….
- Follow the default options and finish the task.
- Go to Tools -> Internet Options -> Content -> Certificates….
- You can see recently installed certificate in Intermediate Certificate Authority tab.
- Select the certificate you want to export and click on Export....
- Follow the default options, give the name & location for the cer file and save it at your disk.
How to make a certificate trusted by JDK?
- To make a certificate trusted by a JDK, it has to added to JRE’s trust keystore.
- To view the trusted certificate list, go to JRE’s security folder (jre1.5.0_06\lib\security) and issue following command: keytool -list -keystore cacerts.
- To add a certificate in this list: keytool -import -alias mycert -keystore cacerts -file d:\mycert.cer.
- The default password for cacerts is changeit.