Last active
December 19, 2017 17:56
-
-
Save mortezaadi/63b4e8c7e23deac90b5c13e47b61d076 to your computer and use it in GitHub Desktop.
Add a certificate to JAVA truststore
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Windows | |
"%jreHome%\bin\keytool.exe" -keystore "%jreHome%\lib\security\cacerts" -importcert -file {filepath} -alias {sample} -storepass {pass} -noprompt | |
Linux: | |
**get the cert from site : | |
echo -n | openssl s_client -connect 185.79.62.45:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > examplecert.crt | |
**add the cert to truststore | |
keytool -import -trustcacerts -keystore /opt/java/jre/lib/security/cacerts -storepass changeit -noprompt -alias mycert -file examplecert.crt | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment