简体   繁体   English

解决 javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed 错误?

[英]Resolving javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed Error?

Edit: I tried to format the question and accepted answer in more presentable way at my blog .编辑:我试图在我的博客上以更形象的方式格式化问题和接受的答案。

Here is the original issue.这是原始问题。

I am getting this error:我收到此错误:

detailed message sun.security.validator.ValidatorException: PKIX path building failed:详细消息 sun.security.validator.ValidatorException:PKIX 路径构建失败:
sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target sun.security.provider.certpath.SunCertPathBuilderException:无法找到请求目标的有效证书路径

cause javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target导致 javax.net.ssl.SSLHandshakeException:sun.security.validator.ValidatorException:PKIX 路径构建失败:sun.security.provider.certpath.SunCertPathBuilderException:无法找到请求目标的有效证书路径

I am using Tomcat 6 as webserver.我使用 Tomcat 6 作为网络服务器。 I have two HTTPS web applications installed on different Tomcats on different ports but on the same machine.我有两个 HTTPS web 应用程序安装在不同端口但在同一台机器上的不同 Tomcat 上。 Say App1 (port 8443) and App2 (port 443).说 App1(端口 8443)和 App2(端口 443)。 App1 connects to App2. App1 连接到 App2。 When App1 connects to App2 I get the above error.当 App1 连接到 App2 时,出现上述错误。 I know this is a very common error so came across many solutions on different forums and sites.我知道这是一个非常常见的错误,因此在不同的论坛和网站上遇到了许多解决方案。 I have the below entry in server.xml of both Tomcats:我在两个 Tomcat 的server.xml中都有以下条目:

keystoreFile="c:/.keystore" 
keystorePass="changeit"

Every site says the same reason that certificate given by app2 is not in the trusted store of app1 jvm. This seems to be true also when I tried to hit the same URL in IE browser, it works (with warming, There is a problem with this web site's security certificate. Here I say continue to this website).每个站点都说 app2 提供的证书不在 app1 jvm 的受信任存储中的相同原因。当我尝试在 IE 浏览器中访问相同的 URL 时,这似乎也是如此,它有效(随着变暖,有一个问题这个web网站的安全证书。这里我说继续这个网站)。 But when same URL is hit by Java client (in my case) I get the above error.但是当相同的 URL 被 Java 客户端(在我的例子中)击中时,我得到了上述错误。 So to put it in the truststore I tried these three options:所以为了把它放在信任库中,我尝试了这三个选项:

Option 1选项1

System.setProperty("javax.net.ssl.trustStore", "C:/.keystore");
System.setProperty("javax.net.ssl.trustStorePassword", "changeit");

Option 2选项 2

Setting below in environment variable在环境变量中设置如下

CATALINA_OPTS -- param name
-Djavax.net.ssl.trustStore=C:\.keystore -Djavax.net.ssl.trustStorePassword=changeit ---param value

Option 3选项 3

Setting below in environment variable在环境变量中设置如下

JAVA_OPTS -- param name
-Djavax.net.ssl.trustStore=C:\.keystore -Djavax.net.ssl.trustStorePassword=changeit ---param value

Result结果

But nothing worked.但没有任何效果。

What at last worked is executing the Java approach suggested in How to handle invalid SSL certificates with Apache HttpClient?最后起作用的是执行How to handle invalid SSL certificates with Apache HttpClient? 中建议的 Java 方法? by Pascal Thivent ie executing the program InstallCert.由 Pascal Thivent 即执行程序 InstallCert。

But this approach is fine for devbox setup but I can not use it at production environment.但是这种方法适用于 devbox 设置,但我不能在生产环境中使用它。

I am wondering why three approaches mentioned above did not work when I have mentioned the same values in server.xml of App2 server and same values in truststore by setting我想知道为什么当我通过设置在 App2 服务器的server.xml和信任库中提到相同的值时,上面提到的三种方法不起作用

System.setProperty("javax.net.ssl.trustStore", "C:/.keystore") and System.setProperty("javax.net.ssl.trustStorePassword", "changeit");

in App1 program.在 App1 程序中。

For more information this is how I am making the connection:有关更多信息,这就是我建立连接的方式:

URL url = new URL(urlStr);

URLConnection conn = url.openConnection();

if (conn instanceof HttpsURLConnection) {

  HttpsURLConnection conn1 = (HttpsURLConnection) url.openConnection();
  
  conn1.setHostnameVerifier(new HostnameVerifier() {
    public boolean verify(String hostname, SSLSession session) {
      return true;
    }
  });

  reply.load(conn1.getInputStream());

You need to add the certificate for App2 to the truststore file of the used JVM located at $JAVA_HOME\lib\security\cacerts .您需要将App2的证书添加到位于$JAVA_HOME\lib\security\cacerts的所用JVM的信任库文件中。

First you can check if your certificate is already in the truststore by running the following command: keytool -list -keystore "$JAVA_HOME/jre/lib/security/cacerts" (you don't need to provide a password)首先,您可以通过运行以下命令检查您的证书是否已经在信任库中: keytool -list -keystore "$JAVA_HOME/jre/lib/security/cacerts" (您不需要提供密码)

If your certificate is missing, you can get it by downloading it with your browser and add it to the truststore with the following command:如果您的证书丢失,您可以使用浏览器下载它并使用以下命令将其添加到信任库中:

keytool -import -noprompt -trustcacerts -alias <AliasName> -file   <certificate> -keystore <KeystoreFile> -storepass <Password>

Example:例子:

keytool -import -noprompt -trustcacerts -alias myFancyAlias -file /path/to/my/cert/myCert.cer -keystore /path/to/my/jdk/jre/lib/security/cacerts/keystore.jks -storepass changeit

After import you can run the first command again to check if your certificate was added.导入后,您可以再次运行第一个命令以检查您的证书是否已添加。

Sun/Oracle information can be found here .可以在此处找到 Sun/Oracle 信息。

javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target javax.net.ssl.SSLHandshakeException:sun.security.validator.ValidatorException:PKIX 路径构建失败:sun.security.provider.certpath.SunCertPathBuilderException:无法找到请求目标的有效证书路径

• When I got the error, I tried to Google out the meaning of the expression and I found, this issue occurs when a server changes their HTTPS SSL certificate, and our older version of java doesn't recognize the root certificate authority (CA). • 当我收到错误消息时,我尝试用谷歌搜索该表达式的含义,我发现,当服务器更改其 HTTPS SSL 证书时会出现此问题,并且我们的旧版 java 无法识别根证书颁发机构 (CA) .

• If you can access the HTTPS URL in your browser then it is possible to update Java to recognize the root CA. • 如果您可以在浏览器中访问 HTTPS URL,则可以更新 Java 以识别根 CA。

• In your browser, go to the HTTPS URL that Java could not access. • 在您的浏览器中,转到Java 无法访问的HTTPS URL。 Click on the HTTPS certificate chain (there is lock icon in the Internet Explorer), click on the lock to view the certificate.点击 HTTPS 证书链(Internet Explorer 中有锁图标),点击锁查看证书。

• Go to “Details” of the certificate and “Copy to file”. • 转到证书的“详细信息”和“复制到文件”。 Copy it in Base64 (.cer) format.Base64 (.cer)格式复制它。 It will be saved on your Desktop.它将保存在您的桌面上。

• Install the certificate ignoring all the alerts. • 安装证书忽略所有警报。

• This is how I gathered the certificate information of the URL that I was trying to access. • 这就是我收集我试图访问的 URL 的证书信息的方式。

Now I had to make my java version to know about the certificate so that further it doesn't refuse to recognize the URL.现在我必须让我的 java 版本知道证书,这样它就不会拒绝识别 URL。 In this respect I must mention that I googled out that root certificate information stays by default in JDK's \jre\lib\security location, and the default password to access is: changeit.在这方面我必须提到,我在 google 上搜索到根证书信息默认保留在 JDK 的\jre\lib\security位置,并且访问的默认密码是: changeit。

To view the cacerts information the following are the procedures to follow:要查看 cacerts 信息,请遵循以下步骤:

• Click on Start Button-->Run • 单击开始按钮-->运行

• Type cmd. • 键入 cmd。 The command prompt opens (you may need to open it as administrator).命令提示符打开(您可能需要以管理员身份打开它)。

• Go to your Java/jreX/bin directory • 转到您的Java/jreX/bin目录

• Type the following • 键入以下内容

keytool -list -keystore D:\Java\jdk1.5.0_12\jre\lib\security\cacerts

It gives the list of the current certificates contained within the keystore.它给出了包含在密钥库中的当前证书的列表。 It looks something like this:它看起来像这样:

C:\Documents and Settings\NeelanjanaG>keytool -list -keystore D:\Java\jdk1.5.0_12\jre\lib\security\cacerts

Enter keystore password:  changeit

Keystore type: jks

Keystore provider: SUN

Your keystore contains 44 entries

verisignclass3g2ca, Mar 26, 2004, trustedCertEntry,

Certificate fingerprint (MD5): A2:33:9B:4C:74:78:73:D4:6C:E7:C1:F3:8D:CB:5C:E9

entrustclientca, Jan 9, 2003, trustedCertEntry,

Certificate fingerprint (MD5): 0C:41:2F:13:5B:A0:54:F5:96:66:2D:7E:CD:0E:03:F4

thawtepersonalbasicca, Feb 13, 1999, trustedCertEntry,

Certificate fingerprint (MD5): E6:0B:D2:C9:CA:2D:88:DB:1A:71:0E:4B:78:EB:02:41

addtrustclass1ca, May 1, 2006, trustedCertEntry,

Certificate fingerprint (MD5): 1E:42:95:02:33:92:6B:B9:5F:C0:7F:DA:D6:B2:4B:FC

verisignclass2g3ca, Mar 26, 2004, trustedCertEntry,

Certificate fingerprint (MD5): F8:BE:C4:63:22:C9:A8:46:74:8B:B8:1D:1E:4A:2B:F6

• Now I had to include the previously installed certificate into the cacerts. • 现在我必须将以前安装的证书包含在 cacerts 中。

• For this the following is the procedure: • 为此,程序如下:

keytool -import -noprompt -trustcacerts -alias ALIASNAME -file FILENAME_OF_THE_INSTALLED_CERTIFICATE -keystore PATH_TO_CACERTS_FILE -storepass PASSWORD

If you are using Java 7:如果您使用的是 Java 7:

keytool -importcert -trustcacerts -alias ALIASNAME -file PATH_TO_FILENAME_OF_THE_INSTALLED_CERTIFICATE -keystore PATH_TO_CACERTS_FILE -storepass changeit

• It will then add the certificate information into the cacert file. • 然后它将证书信息添加到 cacert 文件中。

It is the solution I found for the Exception mentioned above!!这是我为上述异常找到的解决方案!!

How to work-it in Tomcat 7如何在 Tomcat 7 中工作

I wanted to support a self signed certificate in a Tomcat App but the following snippet failed to work我想在 Tomcat 应用程序中支持自签名证书,但以下代码段无法正常工作

import java.io.DataOutputStream;
import java.net.HttpURLConnection;
import java.net.URL;

public class HTTPSPlayground {
    public static void main(String[] args) throws Exception {

        URL url = new URL("https:// ... .com");
        HttpURLConnection httpURLConnection = (HttpURLConnection) url.openConnection();

        httpURLConnection.setRequestMethod("POST");
        httpURLConnection.setRequestProperty("Accept-Language", "en-US,en;q=0.5");
        httpURLConnection.setDoOutput(true);
        DataOutputStream wr = new DataOutputStream(httpURLConnection.getOutputStream());

        String serializedMessage = "{}";
        wr.writeBytes(serializedMessage);
        wr.flush();
        wr.close();

        int responseCode = httpURLConnection.getResponseCode();
        System.out.println(responseCode);
    }
}

this is what solved my issue:这就是解决我的问题的方法:

1) Download the .crt file 1) 下载.crt文件

echo -n | openssl s_client -connect <your domain>:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > ~/<your domain>.crt
  • replace <your domain> with your domain (eg jossef.com )<your domain>替换为您的域(例如jossef.com

2) Apply the .crt file in Java's cacerts certificate store 2) 在 Java 的cacerts证书存储中应用.crt文件

keytool -import -v -trustcacerts -alias <your domain> -file ~/<your domain>.crt -keystore <JAVA HOME>/jre/lib/security/cacerts -keypass changeit -storepass changeit
  • replace <your domain> with your domain (eg jossef.com )<your domain>替换为您的域(例如jossef.com
  • replace <JAVA HOME> with your java home directory<JAVA HOME>替换为您的 java 主目录

3) Hack it 3)破解它

Even though iv'e installed my certificate in Java 's default certificate stores, Tomcat ignores that (seems like it's not configured to use Java's default certificate stores).即使我在Java的默认证书存储中安装了我的证书, Tomcat 也会忽略这一点(似乎它没有配置为使用 Java 的默认证书存储)。

To hack this, add the following somewhere in your code:要解决这个问题,请在代码中的某处添加以下内容:

String certificatesTrustStorePath = "<JAVA HOME>/jre/lib/security/cacerts";
System.setProperty("javax.net.ssl.trustStore", certificatesTrustStorePath);

// ...

In my case the issue was that the webserver was only sending the certificate and the intermediate CA, not the root CA.在我的情况下,问题是网络服务器只发送证书和中间 CA,而不是根 CA。 Adding this JVM option solved the problem: -Dcom.sun.security.enableAIAcaIssuers=true添加这个 JVM 选项解决了这个问题: -Dcom.sun.security.enableAIAcaIssuers=true

Support for the caIssuers access method of the Authority Information Access extension is available.提供对权威信息访问扩展的 caIssuers 访问方法的支持。 It is disabled by default for compatibility and can be enabled by setting the system property com.sun.security.enableAIAcaIssuers to the value true.出于兼容性考虑,默认情况下禁用它,可以通过将系统属性com.sun.security.enableAIAcaIssuers设置为值 true 来启用它。

If set to true, Sun's PKIX implementation of CertPathBuilder uses the information in a certificate's AIA extension (in addition to CertStores that are specified) to find the issuing CA certificate, provided it is a URI of type ldap, http, or ftp.如果设置为 true,则 Sun 的 CertPathBuilder 的 PKIX 实现使用证书的 AIA 扩展中的信息(除了指定的 CertStores)来查找颁发的 CA 证书,前提是它是 ldap、http 或 ftp 类型的 URI。

Source 资源

Another reason could be an outdated version of JDK.另一个原因可能是 JDK 版本过时。 I was using jdk version 1.8.0_60, simply updating to the latest version solved the certificate issue.我使用的是 jdk 版本 1.8.0_60,只需更新到最新版本即可解决证书问题。

It is possible to disable SSL verification programmatically.可以通过编程方式禁用 SSL 验证。 Works in a pinch for dev, but not recommended for production since you'll want to either use "real" SSL verification there or install and use your own trusted keys and then still use "real" SSL verification.适用于开发人员,但不建议用于生产,因为您需要在那里使用“真实”SSL 验证,或者安装并使用您自己的受信任密钥,然后仍然使用“真实”SSL 验证。

Below code works for me:下面的代码对我有用:

import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;

import javax.net.ssl.X509TrustManager;

public class TrustAnyTrustManager implements X509TrustManager {

  public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException {
  }

  public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException {
  }

  public X509Certificate[] getAcceptedIssuers() {
    return null;
  }
}

             HttpsURLConnection conn = null;
             URL url = new URL(serviceUrl);
             conn = (HttpsURLConnection) url.openConnection();
             SSLContext sc = SSLContext.getInstance("SSL");  
             sc.init(null, new TrustManager[]{new TrustAnyTrustManager()}, new java.security.SecureRandom());  
                    // Create all-trusting host name verifier
             HostnameVerifier allHostsValid = new HostnameVerifier() {
               public boolean verify(String hostname, SSLSession session) {
                return true;
              }
            };
            conn.setHostnameVerifier(allHostsValid);

Or if you don't control the Connection s underneath, you can also override SSL verification globally for all connections https://stackoverflow.com/a/19542614/32453或者如果您不控制下面的Connection ,您还可以全局覆盖所有连接的 SSL 验证https://stackoverflow.com/a/19542614/32453

If you are using Apache HTTPClient you must disable it "differently" (sadly): https://stackoverflow.com/a/2703233/32453如果您使用的是 Apache HTTPClient,则必须“以不同方式”禁用它(可悲): https ://stackoverflow.com/a/2703233/32453

I was using jdk1.8.0_171 when I faced the same issue.当我遇到同样的问题时,我正在使用jdk1.8.0_171 I tried top 2 solutions here (adding a certificate using keytool and another solution which has a hack in it) but they didn't work for me.我在这里尝试了前 2 个解决方案(使用 keytool 添加证书和另一个包含 hack 的解决方案),但它们对我不起作用。

I upgraded my JDK to 1.8.0_181 and it worked like a charm.我将我的 JDK 升级到1.8.0_181 ,它就像一个魅力。

My cacerts file was totally empty.我的 cacerts 文件完全是空的。 I solved this by copying the cacerts file off my windows machine (that's using Oracle Java 7) and scp'd it to my Linux box (OpenJDK).我通过将 cacerts 文件从我的 Windows 机器(使用 Oracle Java 7)复制并将其 scp'd 到我的 Linux 机器(OpenJDK)来解决了这个问题。

cd %JAVA_HOME%/jre/lib/security/
scp cacerts mylinuxmachin:/tmp

and then on the linux machine然后在linux机器上

cp /tmp/cacerts /etc/ssl/certs/java/cacerts

It's worked great so far.到目前为止效果很好。

Using Tomcat 7 under Linux, this did the trick.在 Linux 下使用 Tomcat 7,就成功了。

String certificatesTrustStorePath = "/etc/alternatives/jre/lib/security/cacerts";
System.setProperty("javax.net.ssl.trustStore", certificatesTrustStorePath);
System.setProperty("javax.net.ssl.trustStorePassword", "changeit");

Under Linux, $JAVA_HOME is not always setup, but usually /etc/alternatives/jre points to $JAVA_HOME/jre在 Linux 下, $JAVA_HOME并不总是设置,但通常/etc/alternatives/jre指向$JAVA_HOME/jre

For me, this error appeared too while trying to connect to a process behind an NGINX reverse proxy which was handling the SSL.对我来说,在尝试连接到处理 SSL 的 NGINX 反向代理后面的进程时,也会出现此错误。

It turned out the problem was a certificate without the entire certificate chain concatenated.事实证明,问题在于没有连接整个证书链的证书。 When I added intermediate certs, the problem was solved.当我添加中间证书时,问题就解决了。

Hope this helps.希望这可以帮助。

DEPLOYABLE SOLUTION (Alpine Linux)可部署的解决方案(Alpine Linux)

To be able to fix this issue in our application environments, we have prepared Linux terminal commands as follows:为了能够在我们的应用环境中解决这个问题,我们准备了如下的 Linux 终端命令:

cd ~

Will generate cert file in home directory.将在主目录中生成证书文件。

apk add openssl

This command installs openssl in alpine Linux.此命令在 alpine Linux 中安装 openssl。 You can find proper commands for other Linux distributions.您可以找到适用于其他 Linux 发行版的正确命令。

openssl s_client -connect <host-dns-ssl-belongs> < /dev/null | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > public.crt

Generated the needed cert file.生成所需的证书文件。

sudo $JAVA_HOME/bin/keytool -import -alias server_name -keystore $JAVA_HOME/lib/security/cacerts -file public.crt -storepass changeit -noprompt

Applied the generated file to the JRE with the program 'keytool'.使用程序“keytool”将生成的文件应用到 JRE。

Note: Please replace your DNS with <host-dns-ssl-belongs>注意:请将您的 DNS 替换为<host-dns-ssl-belongs>

Note2: Please gently note that -noprompt will not prompt the verification message (yes/no) and -storepass changeit parameter will disable password prompt and provide the needed password (default is 'changeit').注意2:请注意, -noprompt不会提示验证信息(是/否),- -storepass changeit参数将禁用密码提示并提供所需的密码(默认为'changeit')。 These two properties will let you use those scripts in your application environments like building a Docker image.这两个属性将允许您在应用程序环境中使用这些脚本,例如构建 Docker 映像。

Note3 If you are deploying your app via Docker, you can generate the secret file once and put it in your application project files. Note3如果您通过 Docker 部署您的应用程序,您可以生成一次密钥文件并将其放入您的应用程序项目文件中。 You won't need to generate it again and again.您不需要一次又一次地生成它。

i wrote a small win32 (WinXP 32bit testet) stupid cmd (commandline) script which looks for all java versions in program files and adds a cert to them.我写了一个小的win32(WinXP 32bit testet)愚蠢的cmd(命令行)脚本,它在程序文件中查找所有java版本并向它们添加一个证书。 The Password needs to be the default "changeit" or change it yourself in the script :-)密码需要是默认的“changeit”或在脚本中自己更改:-)

@echo off

for /F  %%d in ('dir /B %ProgramFiles%\java') do (
    %ProgramFiles%\Java\%%d\bin\keytool.exe -import -noprompt -trustcacerts -file some-exported-cert-saved-as.crt -keystore %ProgramFiles%\Java\%%d\lib\security\cacerts -storepass changeit
)

pause

for safety we should not use self signed certificates in our implementation.为了安全起见,我们不应该在我们的实现中使用自签名证书。 However, when it comes to development often we have to use trial environments which got self-signed certs.但是,在开发方面,我们通常必须使用获得自签名证书的试用环境。 I tried to fix this issue programmatically in my code and I fail.我试图在我的代码中以编程方式解决这个问题,但我失败了。 However, by adding the cert to the jre trust-store fixed my issue.但是,通过将证书添加到 jre 信任库解决了我的问题。 Please find below steps,请找到以下步骤,

  1. Download the site cert,下载网站证书,

  2. Copy the certificate(ex:cert_file.cer) into the directory $JAVA_HOME\Jre\Lib\Security将证书(例如:cert_file.cer)复制到目录 $JAVA_HOME\Jre\Lib\Security

  3. Open CMD in Administrator and change the directory to $JAVA_HOME\Jre\Lib\Security在 Administrator 中打开 CMD 并将目录更改为 $JAVA_HOME\Jre\Lib\Security

  4. Import the certificate to a trust store using below command,使用以下命令将证书导入信任库,

keytool -import -alias ca -file cert_file.cer -keystore cacerts -storepass changeit keytool -import -alias ca -file cert_file.cer -keystore cacerts -storepass changeit

If you got a error saying keytool is not recognizable please refer this.如果您收到错误提示 keytool 无法识别,请参考此内容。

Type yes like below像下面这样输入

Trust this certificate: [Yes]信任此证书: [是]

  1. Now try to run your code or access the URL programmatically using java.现在尝试运行您的代码或使用 java 以编程方式访问 URL。

Update更新

If your app server is jboss try adding below system property如果您的应用服务器是 jboss,请尝试添加以下系统属性

System.setProperty("org.jboss.security.ignoreHttpsHost","true");

Hope this helps!希望这可以帮助!

This seems as good a place as any to document another possible reason for the infamous PKIX error message.这似乎是记录臭名昭著的 PKIX 错误消息的另一个可能原因的好地方。 After spending far too long looking at the keystore and truststore contents and various java installation configs I realised that my issue was down to... a typo.在查看密钥库和信任库内容以及各种 java 安装配置太久之后,我意识到我的问题归结为......一个错字。

The typo meant that I was also using the keystore as the truststore.错字意味着我也使用密钥库作为信任库。 As my companies Root CA was not defined as a standalone cert in the keystore but only as part of a cert chain, and was not defined anywhere else (ie cacerts) I kept getting the PKIX error.由于我的公司根 CA 没有被定义为密钥库中的独立证书,而只是作为证书链的一部分,并且没有在其他任何地方定义(即 cacerts),所以我不断收到 PKIX 错误。

After a failed release (this is prod config, it was ok elsewhere) and two days of head scratching I finally saw the typo, and now all is good.在发布失败(这是产品配置,其他地方没问题)和两天的头疼之后,我终于看到了错字,现在一切都很好。

Hope this helps someone.希望这可以帮助某人。

对于 MacOS X,下面是对我有用的确切命令,我不得不在“importcert”选项中尝试使用双连字符,该命令有效:

sudo keytool -–importcert -file /PathTo/YourCertFileDownloadedFromBrowserLockIcon.crt -keystore /Library/Java/JavaVirtualMachines/jdk1.8.0_191.jdk/Contents/Home/jre/lib/security/cacerts -alias "Cert" -storepass changeit

For me didn't work the recognized solution from this post: https://stackoverflow.com/a/9619478/4507034 .对我来说,这篇文章没有得到公认的解决方案: https ://stackoverflow.com/a/9619478/4507034。

Instead, I managed to solve the problem by importing the certification to my machine trusted certifications.相反,我设法通过将证书导入我的机器受信任证书来解决问题。

Steps:脚步:

  1. Go to the URL (eg. https://localhost:8443/yourpath ) where the certification is not working.转到认证不起作用的 URL(例如https://localhost:8443/yourpath )。
  2. Export the certification as described in the mentioned post.按照上述帖子中的说明导出证书。
  3. On your windows machine open: Manage computer certificates在您的 Windows 机器上打开: Manage computer certificates
  4. Go to Trusted Root Certification Authorities -> Certificates转到Trusted Root Certification Authorities -> Certificates
  5. Import here your your_certification_name.cer file.在此处导入您的your_certification_name.cer文件。

I have this problem too.我也遇到了这个问题。

I tried almost everything by adding the SSL cert to .keystore, but, it was not working with Java1_6_x.通过将 SSL 证书添加到 .keystore,我几乎尝试了所有方法,但是它不适用于 Java1_6_x。 For me it helped if we start using newer version of Java, Java1_8_x as JVM.对我来说,如果我们开始使用更新版本的 Java,Java1_8_x 作为 JVM,它会有所帮助。

I want to chime in since I have a QEMU environment where I have to download files in java.我想插话,因为我有一个 QEMU 环境,我必须在 Java 中下载文件。 It turns out the /etc/ssl/certs/java/cacerts in QEMU does have problem because it does not match the /etc/ssl/certs/java/cacerts in the host environment.事实证明,QEMU 中的/etc/ssl/certs/java/cacerts确实存在问题,因为它与主机环境中的/etc/ssl/certs/java/cacerts不匹配。 The host environment is behind a company proxy so the java cacerts is a customized version.主机环境位于公司代理后面,因此 java cacerts 是自定义版本。

If you are using a QEMU environment, make sure the host system can access files first.如果您使用的是 QEMU 环境,请确保主机系统首先可以访问文件。 For example you can try this script on your host machine first to see.例如,您可以先在主机上尝试 此脚本以查看。 If the script runs just fine in host machine but not in QEMU, then you are having the same problem as me.如果脚本在主机上运行得很好,但在 QEMU 中却没有,那么你遇到了和我一样的问题。

To solve this issue, I had to make a backup of the original file in QEMU, copy over the file in host environment to the QEMU chroot jail, and then java could download files normally in QEMU.为了解决这个问题,我只好把QEMU中的原文件备份了,将宿主环境中的文件拷贝到QEMU chroot jail中,然后java就可以在QEMU中正常下载文件了。

A better solution would be mount the /etc into the QEMU environment;更好的解决方案是将/etc挂载到 QEMU 环境中; however I am not sure if other files will get impacted in this process.但是我不确定其他文件是否会在此过程中受到影响。 So I decided to use this ugly but easy work-around.所以我决定使用这个丑陋但简单的解决方法。

My two cents: In my case, cacerts was not a folder, but a file, and also it was presents on two paths After discover it, error disappeared after copy the .jks file over that file.我的两分钱:就我而言, cacerts 不是文件夹,而是文件,而且它存在于两个路径上发现它后,将 .jks 文件复制到该文件上后错误消失了。

# locate cacerts    
/usr/java/jdk1.8.0_221-amd64/jre/lib/security/cacerts
/usr/java/jre1.8.0_221-amd64/lib/security/cacerts

After backup them, I copy the .jks over.备份它们后,我将 .jks 复制过来。

cp /path_of_jks_file/file.jks /usr/java/jdk1.8.0_221-amd64/jre/lib/security/cacerts
cp /path_of_jks_file/file.jks /usr/java/jre1.8.0_221-amd64/lib/security/cacerts

Note: this basic trick resolves this error on a Genexus project, in spite file.jks is also on the server.xml file of the Tomcat.注意:这个基本技巧解决了 Genexus 项目上的这个错误,尽管 file.jks 也在 Tomcat 的 server.xml 文件中。

I am using flutter and received this error out of nowhere.我正在使用颤振并突然收到此错误。 So, what basically happens is that the lines within your dependencies within android/build.gradle file such as:因此,基本上发生的是android/build.gradle文件中的依赖项中的行,例如:

  classpath 'com.android.tools.build:gradle:4.1.0'
  classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

require certification that the grade file downloads from the internet.需要证明成绩文件是从 Internet 下载的。 But when there is something that's blocking the gradle to download those certificates, this is typically shown.但是当有东西阻止 gradle 下载这些证书时,通常会显示出来。

I tried exporting the certificate and adding it manually but it didn't seem to work for me.我尝试导出证书并手动添加它,但它似乎对我不起作用。 What worked for me, after countless head scratches, was disabling the proxies from your network preferences.在无数次挠头之后,对我有用的是从您的网络偏好中禁用代理。 It was somewhere mentioned that disabling Charles Proxy would fix it but at that moment, I was clueless what Charles was and what proxy was.有人提到禁用 Charles Proxy 会修复它,但在那一刻,我不知道 Charles 是什么以及代理是什么。 And in my case, I did not have the Charles proxy thing so I went on with finding the proxies in the network preferences settings in Mac( it could be found somewhere in network settings for Windows).在我的情况下,我没有 Charles 代理,所以我继续在 Mac 的网络首选项设置中查找代理(它可以在 Windows 的网络设置中的某处找到)。 I had Socks enabled within the proxy.我在代理中启用了 Socks。 I disabled it and then again rebuilt the gradle and TA-DAH!!!我禁用了它,然后再次重建了 gradle 和 TA-DAH !!! It worked butter smooth.它工作黄油光滑。

There are a few things to remember.有几件事要记住。 If you build your project right after disabling proxy without closing the network preferences tab, the disable proxies won't work and it will show the same error.如果您在禁用代理后立即构建项目而不关闭网络首选项选项卡,则禁用代理将不起作用,并且会显示相同的错误。 Also if you've already built the project and you're running it again after disabling proxies, chances are it's gonna show the same error( could be due to IDE caches).此外,如果您已经构建了项目并且在禁用代理后再次运行它,那么它很可能会显示相同的错误(可能是由于 IDE 缓存)。 How it worked for me: Restart the Mac, open a few tabs in the browser( for a few network calls), check the network preferences from system preferences>> wifi and disable proxies, close the system preferences app, and build the project.它对我的工作原理:重新启动 Mac,在浏览器中打开几个选项卡(用于一些网络调用),从系统首选项>> wifi 中检查网络首选项并禁用代理,关闭系统首选项应用程序,然后构建项目。

For Tomcat running on Ubuntu server, to find out which Java is being used, use "ps -ef | grep tomcat" command:对于在 Ubuntu 服务器上运行的 Tomcat,要找出正在使用的 Java,请使用“ps -ef | grep tomcat”命令:

Sample:样本:

/home/mcp01$ **ps -ef |grep tomcat**
tomcat7  28477     1  0 10:59 ?        00:00:18 **/usr/local/java/jdk1.7.0_15/bin/java** -Djava.util.logging.config.file=/var/lib/tomcat7/conf/logging.properties -Djava.awt.headless=true -Xmx512m -XX:+UseConcMarkSweepGC -Djava.net.preferIPv4Stack=true -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=/usr/share/tomcat7/endorsed -classpath /usr/share/tomcat7/bin/bootstrap.jar:/usr/share/tomcat7/bin/tomcat-juli.jar -Dcatalina.base=/var/lib/tomcat7 -Dcatalina.home=/usr/share/tomcat7 -Djava.io.tmpdir=/tmp/tomcat7-tomcat7-tmp org.apache.catalina.startup.Bootstrap start
1005     28567 28131  0 11:34 pts/1    00:00:00 grep --color=auto tomcat

Then, we can go in to: cd /usr/local/java/jdk1.7.0_15/jre/lib/security然后,我们可以进入: cd /usr/local/java/jdk1.7.0_15/jre/lib/security

Default cacerts file is located in here.默认cacerts文件位于此处。 Insert the untrusted certificate into it.将不受信任的证书插入其中。

I run into this problem using AndroidStudio , Charles Proxy , JUnit and Robolectric . 我使用AndroidStudioCharles ProxyJUnitRobolectric遇到了这个问题。 Thanks @SimonSez I could solve the issue. 谢谢@SimonSez,我可以解决这个问题。

Please note: Since the key point is modifying cacerts that can cause some problems(eg updating IDE ) I would recommend you copy the original cacerts file into separate directory and manipulate them when needed. 请注意:由于关键是修改cacerts会导致一些问题(例如, 更新IDE ),所以我建议您原始cacerts文件复制到单独的目录中,并在需要时进行操作。

  1. %JAVA_HOME% - Android uses a different JavaHome. %JAVA_HOME% -Android使用其他JavaHome。 You can find a full path in UnitTests resulr tab. 您可以在UnitTests resulr标签中找到完整路径。 In my case it is /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home 就我而言,它是/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home

    在此处输入图片说明

  2. Download Charles Certificate (eg Downloads folder) 下载查尔斯证书(例如, Downloads文件夹)

  3. Run the command 运行命令

    sudo keytool -import -noprompt -trustcacerts -alias charles -file <path to Charles certificate.pem> -keystore "JAVA_HOME/jre/lib/security/cacerts" -storepass changeit

    For example 例如

    sudo keytool -import -noprompt -trustcacerts -alias charles -file ~/Downloads/charles-ssl-proxying-certificate.pem -keystore "/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/jre/lib/security/cacerts" -storepass changeit

The official Charles doc 官方查尔斯文件

  • Make sure of your JVM location.确保您的 JVM 位置。 There can be half a dozen JREs on your system.您的系统上可能有六个 JRE。 Which one is your Tomcat really using?您的 Tomcat 真正使用的是哪一个? Anywhere inside code running in your Tomcat, write println(System.getProperty("java.home")).在 Tomcat 中运行的代码中的任何位置,编写 println(System.getProperty("java.home"))。 Note this location.注意这个位置。 In <java.home>/lib/security/cacerts file are the certificates used by your Tomcat.在 <java.home>/lib/security/cacerts 文件中是 Tomcat 使用的证书。
  • Find the root certificate that is failing.查找失败的根证书。 This can be found by turning on SSL debug using -Djavax.net.debug=all.这可以通过使用 -Djavax.net.debug=all 打开 SSL 调试来找到。 Run your app and note from console ssl logs the CA that is failing.运行您的应用程序并从控制台 ssl 记录失败的 CA。 Its url will be available.它的 url 将可用。 In my case I was surprised to find that a proxy zscaler was the one which was failing, as it was actually proxying my calls, and returning its own CA certificate.就我而言,我惊讶地发现代理 zscaler 是失败的,因为它实际上是代理我的调用,并返回它自己的 CA 证书。
  • Paste url in browser.将网址粘贴到浏览器中。 Certificate will get downloaded.证书将被下载。
  • Import this certificate into cacerts using keytool import.使用 keytool import 将此证书导入 cacerts。

I ran into this issue while making REST calls from my app server running in AWS EC2.我从在 AWS EC2 中运行的应用服务器进行 REST 调用时遇到了这个问题。 The following Steps fixed the issue for me.以下步骤为我解决了这个问题。

  1. curl -vs https://your_rest_path curl -vs https://your_rest_path
  2. echo |回声 | openssl s_client -connect your_domain:443 openssl s_client -connect your_domain:443
  3. sudo apt-get install ca-certificates sudo apt-get install ca-certificates

curl -vs https://your_rest_path will now work! curl -vs https://your_rest_path 现在可以工作了!

I also have the same problem on Apache Tomcat/7.0.67 and Java JVM Version: 1.8.0_66-b18.我在 Apache Tomcat/7.0.67 和 Java JVM Version: 1.8.0_66-b18 上也有同样的问题。 With upgrading Java to JRE 1.8.0_241 and it seems that the issue was solved.随着将 Java 升级到 JRE 1.8.0_241,问题似乎得到了解决。

If you are using JDK 11, the folder doesn't have JRE in it anymore.如果您使用的是 JDK 11,则该文件夹中不再包含 JRE。 The location for the certs is jdk-11.0.11/lib/security/cacerts.证书的位置是 jdk-11.0.11/lib/security/cacerts。

For OkHttpClient, this solution worked for me.对于 OkHttpClient,这个解决方案对我有用。 It might help someone using the library...它可能会帮助使用图书馆的人......

try {

            String proxyHost = "proxy_host";
            String proxyUsername = "proxy_username";
            String proxyPassword = "proxy_password";

            Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(proxyHost, "port goes here"));

            // Create a trust manager that does not validate certificate chains
            TrustManager[] trustAllCerts = new TrustManager[]{
                new X509TrustManager() {
                    @Override
                    public java.security.cert.X509Certificate[] getAcceptedIssuers() {
                        return new java.security.cert.X509Certificate[]{};
                    }
                    @Override
                    public void checkClientTrusted(
                            java.security.cert.X509Certificate[] certs, String authType) {
                    }
                    @Override
                    public void checkServerTrusted(
                            java.security.cert.X509Certificate[] certs, String authType) {
                    }
                }
            };

            // Install the all-trusting trust manager
            final SSLContext sslContext = SSLContext.getInstance("SSL");
            sslContext.init(null, trustAllCerts, new java.security.SecureRandom());
            // Create an ssl socket factory with our all-trusting manager
            final SSLSocketFactory sslSocketFactory = sslContext.getSocketFactory();

            OkHttpClient client = new OkHttpClient().newBuilder()
                    .sslSocketFactory(sslSocketFactory, (X509TrustManager) trustAllCerts[0])
                    .hostnameVerifier((hostname, session) -> true)
                    .connectTimeout(timeout, TimeUnit.SECONDS)
                    .proxy(proxy)
                    .proxyAuthenticator((route, response) -> {
                        String credential = Credentials.basic(proxyUsername, proxyPassword);
                        return response.request().newBuilder()
                                .header("Proxy-Authorization", credential)
                                .build();
                    })
                    .build();

            MediaType mediaType = MediaType.parse("application/json");
            RequestBody requestBody = RequestBody.create(payload, mediaType);

            Request request = new Request.Builder()
                    .url(url)
                    .header("Authorization", "authorization data goes here")
                    .method(requestMethod, requestBody)
                    .build();

            Response response = client.newCall(request).execute();

            resBody = response.body().string();

            int responseCode = response.code();

        } catch (Exception ex) {
        }

Looking on various certificates contents and the ones generated through the standard openssl procedure i noticed that the AutorityKeyIdentifier was set, for the openssl root certificate, to itself.查看各种证书内容以及通过标准 openssl 程序生成的内容,我注意到为 openssl 根证书设置了 AutorityKeyIdentifier 自身。 Probably there is a way to overcome that...but i don't know it...可能有办法克服它......但我不知道......

Then i developed a small application with Java11 & BouncyCastle to generate root certificates and keys, now on github: https://github.com/kendarorg/JavaCaCertGenerator然后我用 Java11 和 BouncyCastle 开发了一个小应用程序来生成根证书和密钥,现在在 github 上: https ://github.com/kendarorg/JavaCaCertGenerator

The root certificates generated with this tool DOES NOT CONTAINS the AuthorityKeyIdentifier and can be installed with keytool directly on the cacert store.使用此工具生成的根证书不包含 AuthorityKeyIdentifier,并且可以使用 keytool 直接安装在 cacert 存储中。 When i create then the csr and the ext file with the domain names this will be validated against the cacert store containing the root.. and no more handshake exceptions!当我创建 csr 和带有域名的 ext 文件时,这将针对包含根的 cacert 存储进行验证.. 并且没有更多的握手异常!

May be the cacert does not allow a recursive AuthorityKeyIdentifier?可能是cacert不允许递归AuthorityKeyIdentifier? I don'know but i'll appreciate some review :)我不知道,但我会感谢一些评论:)

I was getting this error in Android Studio.我在 Android Studio 中遇到了这个错误。 SO i did this after a lot of research.所以我经过大量研究后做到了这一点。

Password is changeit for cacert cacert的密码是changeit

Step 1 : Open CMD as Administrator第 1 步:以管理员身份打开 CMD

Step 2 : Type "Powershell"第 2 步:输入“Powershell”

Step 3 : start-process powershell -verb runas第 3 步:启动进程 powershell -verb runas

Step 4 : Add all your Certificate in C:\Program Files\Android\Android Studio\jre\lib\security this location where cacert is available.第 4 步:将您的所有证书添加到 C:\Program Files\Android\Android Studio\jre\lib\security 这个 cacert 可用的位置。

Step 5 : Go to Keytool directory Set-Location -Path "C:\Program Files\Android\Android Studio\jre\bin"第 5 步:转到 Keytool 目录 Set-Location -Path "C:\Program Files\Android\Android Studio\jre\bin"

Step 6 : run this command in powershell .\keytool -importcert -trustcacerts -alias GiveNameforyourcertificate -file "C:\Program Files\Android\Android Studio\jre\lib\security\Replace With Your Certificate name.cer" -keystore cacerts第 6 步:在 powershell 中运行此命令 .\keytool -importcert -trustcacerts -alias GiveNameforyourcertificate -file "C:\Program Files\Android\Android Studio\jre\lib\security\Replace With Your Certificate name.cer" -keystore cacerts

Step 7 : If Error comes as Certificate added (Access denied) then create a D drive partition( https://www.diskpart.com/windows-10/how-to-create-d-drive-from-c-drive-in-windows-10-0725.html ) or move you file to d drive then add certificate第 7 步:如果添加证书时出现错误(拒绝访问),则创建 D 驱动器分区( https://www.diskpart.com/windows-10/how-to-create-d-drive-from-c-drive- in-windows-10-0725.html )或将您的文件移动到 d 驱动器然后添加证书

If you kept your file in D drive then only execute this如果您将文件保存在 D 驱动器中,则仅执行此操作

Step 8 : keytool -importcert -trustcacerts -alias Nameyourcertificate -file "D:\Certificatename.cer" -keystore cacerts第 8 步:keytool -importcert -trustcacerts -alias Nameyourcertificate -file "D:\Certificatename.cer" -keystore cacerts

Step 9 : Check if certificate was added or not using this command .\keytool -list -keystore cacerts第 9 步:使用此命令检查是否添加了证书。\keytool -list -keystore cacerts

We too had same issue and we did all following things.我们也有同样的问题,我们做了以下所有事情。

  1. Reimported Server SSL certificates.重新导入服务器 SSL 证书。
  2. Made sure weblogic is using the proper caecerts.确保 weblogic 使用正确的 caecerts。

Finally our weblogic enabled weblogic DEBUG mode and found there is "NOT HANDSHAKED" exception.最后我们的weblogic启用了weblogic DEBUG模式,发现有“NOT HANDSHAKED”异常。

Reason we found is, client system is using jdk 1.6 and server is using higher jdk version ( 1.8) because of which there is some TLS version mismatch causing the issue.我们发现的原因是,客户端系统使用的是 jdk 1.6,而服务器使用的是更高版本的 jdk (1.8),因此存在一些 TLS 版本不匹配导致的问题。

Weblogic team tweaked server configuration by adding following lines in server arguments. Weblogic 团队通过在服务器 arguments 中添加以下行来调整服务器配置。

"-Djdk.tls.client.protocol=TLSv1.2 -DUseSunHttpHandler=true." “-Djdk.tls.client.protocol=TLSv1.2 -DUseSunHttpHandler=true。”

I was having this problem with Android Studio when I'm behind a proxy.当我在代理后面时,我遇到了 Android Studio 的这个问题。 I was using Crashlytics that tries to upload the mapping file during a build.我正在使用 Crashlytics 尝试在构建期间上传映射文件。

I added the missing proxy certificate to the truststore located at /Users/[username]/Documents/Android Studio.app/Contents/jre/jdk/Contents/Home/jre/lib/security/cacerts我将缺少的代理证书添加到位于/Users/[username]/Documents/Android Studio.app/Contents/jre/jdk/Contents/Home/jre/lib/security/cacerts的信任库

with the following command: keytool -import -trustcacerts -keystore cacerts -storepass [password] -noprompt -alias [alias] -file [my_certificate_location]使用以下命令: keytool -import -trustcacerts -keystore cacerts -storepass [password] -noprompt -alias [alias] -file [my_certificate_location]

for example with the default truststore password keytool -import -trustcacerts -keystore cacerts -storepass changeit -noprompt -alias myproxycert -file /Users/myname/Downloads/MyProxy.crt例如使用默认信任库密码keytool -import -trustcacerts -keystore cacerts -storepass changeit -noprompt -alias myproxycert -file /Users/myname/Downloads/MyProxy.crt

Just a small hack.只是一个小技巧。 Update the URL in the file "hudson.model.UpdateCenter.xml" from https to http将文件“hudson.model.UpdateCenter.xml”中的 URL 从 https 更新为 http

<?xml version='1.1' encoding='UTF-8'?>
<sites>
  <site>
    <id>default</id>
    <url>http://updates.jenkins.io/update-center.json</url>
  </site>
</sites>

Watch out for great answer for @NDeveloper.留意@NDeveloper 的精彩答案。 I did copy-paste of course, changing the values and I was getting我当然做了复制粘贴,改变了价值观,我得到了

Illegal option:  ?import

I did checkout the hyphens and I saw that on that answer was the hyphen using the ASCII我确实检查了连字符,我看到那个答案是使用 ASCII 的连字符

– 8211

If you are getting problems check that the ASCII code that did the trick for me was this code = 45如果您遇到问题,请检查对我有用的 ASCII 代码是否是此代码 = 45

- 45

My code我的代码

keytool -import -noprompt -trustcacerts -alias Certificado -file "C:\Users\JavIut\Desktop\Company\Certificados\Certificado.cer" -keystore "C:\Program Files\Java\jdk1.8.0_121\jre\lib\security\cacerts"

在紧要关头,您可以完全禁用 SSL,或按连接禁用(注意不建议将其用于生产!)请参阅https://stackoverflow.com/a/19542614/32453

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 javax.net.ssl.SSLHandshakeException:sun.security.validator.ValidatorException:PKIX路径构建失败 - javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX 路径构建失败 Flutter - javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed Flutter javax.net.ssl.SSLHandshakeException:sun.security.validator.ValidatorException:PKIX路径构建失败google recaptcha - javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed google recaptcha http GET失败,错误为javax.net.ssl.SSLHandshakeException:sun.security.validator.ValidatorException:PKIX路径构建失败 - http GET failed with error javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed javax.net.ssl.SSLHandshakeException:sun.security.validator.ValidatorException:PKIX路径构建失败发生在一台机器上,但不在另一台机器上 - javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed happens on one machine, but not on the other javax.net.ssl.SSLHandshakeException:sun.security.validator.ValidatorException:PKIX路径构建失败:即使我已经创建了证书 - javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: even i have created the certificate javax.net.ssl.SSLHandshakeException:sun.security.validator.ValidatorException - javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException javax.net.ssl.SSLHandshakeException:sun.security.validator.ValidatorException:证书签名验证失败 - javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: Certificate signature validation failed 线程“主”javax.net.ssl.SSLHandshakeException 中的异常:sun.security.validator.ValidatorException:未找到受信任的证书 - Exception in thread "main" javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: No trusted certificate found 关于sun.security.validator.ValidatorException:PKIX路径构建失败 - Regarding sun.security.validator.ValidatorException: PKIX path building failed
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM