首页 > 编程语言 >Java服务发起HTTPS请求报错:PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderExcept

Java服务发起HTTPS请求报错:PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderExcept

时间:2022-10-08 18:34:54浏览次数:68  
标签:building keystore keytool alias ## cacerts failed 报错 mycert

Java服务发起HTTPS请求报错:PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException

1.从域名的https导出下载证书文件
下载证书
第一步是要下载证书
去你程序要访问的网站,点击那个锁按钮,并点击查看详情(chrome浏览器)


2.切换到jre的/lib/security/下
切换到目录 ${JAVA_HOME}/jre/lib/security
D:\Program Files\Java\jdk1.8.0_11\jre\lib\security

3.##导入命令

如果界面是中文,输入:是
如果界面是英文,输入:yes

##测试的证书
##删除命令
keytool -delete -alias mycert_test -keystore cacerts
##导入命令
keytool -import -alias mycert_test -keystore cacerts -file F://_.nmio.comtest.crt
##查看命令
keytool -list -keystore cacerts -alias mycert_test
##查看密钥库
keytool -list -keystore cacerts


口令输入:changeit
查看证书,口令仍然是 changeit


#生产的证书
keytool -delete -alias mycert_pro -keystore cacerts
keytool -import -alias mycert_pro -keystore cacerts -file F://_.nmio.compro.crt
keytool -list -keystore cacerts -alias mycert_pro

标签:building,keystore,keytool,alias,##,cacerts,failed,报错,mycert
From: https://www.cnblogs.com/oktokeep/p/16769817.html

相关文章