Skip to content

Instantly share code, notes, and snippets.

@mcspring
Last active October 25, 2017 04:41
Show Gist options
  • Save mcspring/c08acad3de127cca6f546fa1fd95dcd4 to your computer and use it in GitHub Desktop.
Save mcspring/c08acad3de127cca6f546fa1fd95dcd4 to your computer and use it in GitHub Desktop.
Java 导入自定义证书
keytool -import -alias ${alias} -keystore ${JAVA_HOME}/jre/lib/security/cacerts -file ${path-to-certificate-file}
  • ${alias} 请替换为你想使用的名称
  • ${JAVA_HOME} 请替换为你自己的 JAVA_HOME 目录
  • ${path-to-certificate-file} 请替换为你的 ca 证书路径

PS: 如果 keytool 要求你输入密码,该值默认为英文 changeit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment