JDK导入自签ca证书

这里以windows平台为例,linux文件路径分隔符有所区别

  • windows平台:
keytool -import -keystore "C:\Program Files\Java\jdk1.8.0_171\jre\lib\security\cacerts" -file C:\Users\zetsu\Desktop\ca\ca.crt -alias onebean-crt
  • linux平台:
keytool -import -keystore "/usr/program/jdk1.8.0_191/jre/lib/security/cacerts" -file /usr/program/certs/ca/ca.crt -alias onebean-crt
  • 输入密码:
changeit
  • 查看所有证书:
keytool -list -keystore "/usr/program/jdk1.8.0_191/jre/lib/security/cacerts"
  • 删除证书:
keytool -delete -keystore "/usr/program/jdk1.8.0_191/jre/lib/security/cacerts"  -alias onebean-crt

你可能感兴趣的:(JDK导入自签ca证书)