java生成https安全证书,解决httpClient访问https出错 编译:javac InstallCert.java 运行:java InstallCert 要访问的网址 结果:Enter certificate to add to trusted keystore or 'q' to quit: [1] 输入1确认生成jssecacerts文件,将证书copy到$JAVA_HOME/jre/lib/security目录下
编译:javac InstallCert.java 运行:java InstallCert 要访问的网址 最后面会输出: Enter certificate to add to trusted keystore or q to quit: [1] 输入1,然后直接回车,会在相应的目录下产生一个名为‘jssecacerts’的证书。将证书copy到$JAVA_HOME/jre/lib/security目录下