【问题标题】:Failing to fetch Google dependencies PKIX Path Building failed无法获取 Google 依赖项 PKIX 路径构建失败
【发布时间】:2019-01-09 10:20:44
【问题描述】:

我在构建项目时得到了这个。我似乎无法下载任何 google 依赖项。

Caused by: 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
at org.apache.http.conn.ssl.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.java:394)
at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.upgrade(DefaultHttpClientConnectionOperator.java:185)
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.upgrade(PoolingHttpClientConnectionManager.java:369)
at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:415)
at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)
at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:184)
at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:88)
at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
at org.gradle.internal.resource.transport.http.HttpClientHelper.performHttpRequest(HttpClientHelper.java:148)
at org.gradle.internal.resource.transport.http.HttpClientHelper.performHttpRequest(HttpClientHelper.java:126)
at org.gradle.internal.resource.transport.http.HttpClientHelper.executeGetOrHead(HttpClientHelper.java:103)
at org.gradle.internal.resource.transport.http.HttpClientHelper.performRequest(HttpClientHelper.java:94)
... 177 more
Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

所有以 Maven 为目标的 Google 依赖项都失败了。不确定是什么问题。

我已尝试将 cacert 添加到我的 Java 证书中,但仍然无法获取。

【问题讨论】:

    标签: android pkix


    【解决方案1】:

    很少检查以缩小问题范围

    1. 结帐this GUIDE 以检查您执行的任何错误步骤。
    2. 出现此异常的双重检查 jre 与您安装 ssl 根证书的完全相同

    通过在命令提示符下键入以下命令进行检查,并查看 java 主路径,并且只有您应该将证书添加到 cacerts。

    mvn -version
    
    1. 确认它是您安装的根 SSL 证书且未过期。如果您安装已过期的非根证书,您可能会遇到问题。

    【讨论】:

      猜你喜欢
      • 2018-10-04
      • 2019-05-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-09-16
      • 2020-06-17
      • 1970-01-01
      相关资源
      最近更新 更多