且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

“无法找到到所请求目标的有效证书路径",但浏览器表示可以

更新时间:2021-11-23 22:26:29

可以在以下密钥库中找到不同的证书:

The different certificates can be found in the following keystore :

%JAVA_HOME%/jre/lib/security/cacerts

%JAVA_HOME%/jre/lib/security/cacerts

如果要列出受信任的证书:

If you want to list the trusted certificates :

keytool -list -keystore %JAVA_HOME%/jre/lib/security/cacerts

密码是可选的列表.

如果要添加条目:

首先,导出要导入的证书,假设它是c:\ cert.crt.***的方法是使用firefox,右键单击URL中的锁定图片,然后单击几下,便具有导出功能.

First, export the certificate to import, let's say it will be c:\cert.crt. The best way to do it is using firefox, right-click on the lock picture in the URL, and after a few clicks, you have an export feature.

然后输入:

keytool -import -alias my-cert -file c:\cert.crt -keystore %JAVA_HOME%/jre/lib/security/cacerts

密码是:changeit

The password is: changeit

别名是用户定义的标签,请明智地选择它,以记住一天是否需要它.

The alias is a user-defined label, choose it wisely, to remember if you need it one day, what it was.

有了这一切,您应该能够信任证书,并使所有内容重新运行.

With all this, you should be able to trust the certificate and have everything working again.