导入信任证书.
JDK中已经存在一个keystore:cacerts,只需将证书导入进去即可
1、进入到$JAVA_HOME/jre/lib/security/ 并将 *.crt、*.cer 证书复制到该目录
2、keytool -import -alias gwtestpublickey -file gwtest.site.crt -keystore cacerts
3、默认密钥库密码: changeit ; 注意: 在输入判断时, 若是中文, 请输入”是”
keytool -import -v -trustcacerts -alias xx -file gwtest.site.cer -storepass changeit -keystore %JAVA_HOME%/jre/lib/security/cacerts
keytool -delete -alias gwtestpublickey -keystore cacerts -storepass changeit
查看现有的证书:
keytool -list -keystore cacerts -storepass changeit
删除证书:
Keytool -delete -alias xx -keystore "%JAVA_HOME%/jre/lib/security/cacerts" -storepass changeit