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

 

下载证书

第一步是要下载证书

去你程序要访问的网站,点击那个锁按钮,并点击查看详情(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

 

导入证书

切换到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

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

 

至此证书导入成功。

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