Below is the command to export certificate of any website and import it to local.
Default password for importing is "changeit". To import certificate in Unix it may need root permission as generally java installed with root.
Export :
----------
openssl s_client -connect <host>:443 < /dev/null | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > certName.crt
Import :
---------
$JAVA_HOME/bin/keytool -import -alias <alias> -keystore $JAVA_HOME/jre/lib/security/cacerts -file <pathToCert>/certName.crt
No comments:
Post a Comment
Thank You for your valuable comment