Add new certificate to Java certificate store
I tried to deploy artifact to company's nexus when I got Java exceptions. I forgot the exact exception but it sounded something like SSL handshake failure and invalid certificate. After further investigation, I found out that the company's nexus is using self signed certificate for its SSL. This certificate is not recognized by Java because it is not yet in Java's keystore. It needs to be added to the keystore.
First step would be to find the keystore. There can be multiple Java installations and maven is using one of them. The keystore is located in jre/lib/security/cacerts.
The content of the keystore can be dumped using the command:
To add new certificate to the keystore:
First step would be to find the keystore. There can be multiple Java installations and maven is using one of them. The keystore is located in jre/lib/security/cacerts.
The content of the keystore can be dumped using the command:
keytool -list -v -keystore /path/to/cacerts > java_cacerts.txt
The default password is changeit.To add new certificate to the keystore:
keytool -import -alias certificatealias -keystore /path/to/cacerts -file certificatefilename
Certificate alias can be anything.
0 komentar:
Posting Komentar