亲测可用!转载告知更多的求知者!

unable to find valid certification path to requested target

这个问题困扰我好久了,之前找到过一个解决方案,可是没用几天那个方案就不怎么奏效了,每次生成的jssecacerts第二天还是会报错。

关于上一个解决方案,参考

Could not connect to SMTP host,PKIX path building failed

今天尝试了另外一个方案,安装证书。

下载证书
第一步是要下载证书

去你程序要访问的网站,点击那个锁按钮,并点击查看详情(chrome浏览器)

彻底解决unable to find valid certification path to requested target

点击View certificate

彻底解决unable to find valid certification path to requested target

点击详细信息

彻底解决unable to find valid certification path to requested target

复制到文件

下一步

彻底解决unable to find valid certification path to requested target

选择格式

彻底解决unable to find valid certification path to requested target

生成的名称,最后保存

彻底解决unable to find valid certification path to requested target

彻底解决unable to find valid certification path to requested target

彻底解决unable to find valid certification path to requested target

这里我保存在的D盘根目录下叫abc.cer

导入证书
切换到jre的/lib/security/下

彻底解决unable to find valid certification path to requested target

执行如下命令

keytool -import -alias abc -keystore cacerts -file D://abc.cer

库**口令输入:changeit

将会看到如下的信息

彻底解决unable to find valid certification path to requested target

是否信任:Y

彻底解决unable to find valid certification path to requested target

证书导入成功

查看证书,**仍然是changeit

keytool -list -keystore cacerts -alias abc
 

彻底解决unable to find valid certification path to requested target
至此证书导入成功。

重新运行程序,看还会不会报错。

备注:

如遇写入证书失败,请使用管理员运行cmd。

jdk的证书更新成功后,如若还遇到此问题,请重启studio或者重启电脑重试,注意控制台报错信息及时修正

参考文献

http://www.mamicode.com/info-detail-99920.html

亲测可用!转载告知更多的求知者!

 

 

相关文章:

  • 2021-09-15
  • 2021-12-07
猜你喜欢
  • 2021-11-08
  • 2021-12-17
相关资源
相似解决方案