Artifactory 从jcenter下载时出错

Artifactory 从jcenter下载时出错,artifactory,bintray,jcenter,Artifactory,Bintray,Jcenter,我们正在使用artifactory oss,从几天以来,我们在从jcenter存储库下载JAR时遇到了一些问题。并非所有下载都适用,原因也不清楚。下载时出现以下错误: Failed retrieving resource from http://jcenter.bintray.com/commons-lang/commons-lang/2.6/commons-lang-2.6.jar: PKIX path building failed: sun.security.provider.certpa

我们正在使用artifactory oss,从几天以来,我们在从jcenter存储库下载JAR时遇到了一些问题。并非所有下载都适用,原因也不清楚。下载时出现以下错误:

Failed retrieving resource from http://jcenter.bintray.com/commons-lang/commons-lang/2.6/commons-lang-2.6.jar: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
奇怪的是,我们试图从http源下载,而不是从https源下载,这与有效的认证是一致的

当查看日志时,我们可以看到有两种不同的下载方法,一种是“httpRepo”,它运行良好,另一种是“RemoteRepoBase”,但不清楚为什么有时使用一种,有时使用另一种

这是一个工作和非工作下载日志的剪报:

2018-05-22 16:03:25,928 [https-jsse-nio-8060-exec-6] [INFO ] (o.a.r.HttpRepo      :414) - jcenter downloading http://jcenter.bintray.com/commons-lang/commons-lang/2.1/commons-lang-2.1.jar 202.85 KB
2018-05-22 16:03:25,992 [https-jsse-nio-8060-exec-6] [INFO ] (o.a.r.HttpRepo      :427) - jcenter downloaded  http://jcenter.bintray.com/commons-lang/commons-lang/2.1/commons-lang-2.1.jar 202.85 KB at 3,247.54 KB/sec
2018-05-22 16:03:52,322 [https-jsse-nio-8060-exec-12] [INFO ] (o.a.r.HttpRepo      :414) - jcenter downloading http://jcenter.bintray.com/commons-lang/commons-lang/2.5/commons-lang-2.5.jar 272.65 KB
2018-05-22 16:03:52,662 [https-jsse-nio-8060-exec-12] [INFO ] (o.a.r.HttpRepo      :427) - jcenter downloaded  http://jcenter.bintray.com/commons-lang/commons-lang/2.5/commons-lang-2.5.jar 272.65 KB at 807.36 KB/sec
2018-05-22 16:03:57,121 [art-exec-6] [INFO ] (o.a.s.a.ArchiveIndexerImpl:145) - Indexing archive: jcenter-cache:commons-lang/commons-lang/2.1/commons-lang-2.1.jar
2018-05-22 16:03:57,328 [art-exec-6] [INFO ] (o.a.s.a.ArchiveIndexerImpl:145) - Indexing archive: jcenter-cache:commons-lang/commons-lang/2.5/commons-lang-2.5.jar
2018-05-22 16:07:58,243 [https-jsse-nio-8060-exec-7] [WARN ] (o.a.r.RemoteRepoBase:433) - jcenter: Error in getting information for 'commons-lang/commons-lang/2.6/commons-lang-2.6.jar' (Failed retrieving resource from http://jcenter.bintray.com/commons-lang/commons-lang/2.6/commons-lang-2.6.jar: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target).
2018-05-22 16:08:10,319 [https-jsse-nio-8060-exec-7] [WARN ] (o.a.r.RemoteRepoBase:433) - jcenter: Error in getting information for 'commons-lang/commons-lang/2.6/commons-lang-2.6.jar' (Failed retrieving resource from http://jcenter.bintray.com/commons-lang/commons-lang/2.6/commons-lang-2.6.jar: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target).
2018-05-22 16:08:13,255 [https-jsse-nio-8060-exec-12] [WARN ] (o.a.r.RemoteRepoBase:433) - jcenter: Error in getting information for 'commons-lang/commons-lang/2.6/commons-lang-2.6.jar' (Failed retrieving resource from http://jcenter.bintray.com/commons-lang/commons-lang/2.6/commons-lang-2.6.jar: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target).
2018-05-22 16:08:13,874 [https-jsse-nio-8060-exec-7] [WARN ] (o.a.r.RemoteRepoBase:433) - jcenter: Error in getting information for 'commons-lang/commons-lang/2.6/commons-lang-2.6.jar' (Failed retrieving resource from http://jcenter.bintray.com/commons-lang/commons-lang/2.6/commons-lang-2.6.jar: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target).
2018-05-22 16:08:22,943 [https-jsse-nio-8060-exec-4] [WARN ] (o.a.r.RemoteRepoBase:433) - jcenter: Error in getting information for 'commons-lang/commons-lang/2.3/commons-lang-2.3.jar' (Failed retrieving resource from http://jcenter.bintray.com/commons-lang/commons-lang/2.3/commons-lang-2.3.jar: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target).
2018-05-22 16:08:35,290 [https-jsse-nio-8060-exec-5] [WARN ] (o.a.r.RemoteRepoBase:433) - jcenter: Error in getting information for 'commons-lang/commons-lang/2.3/commons-lang-2.3.jar' (Failed retrieving resource from http://jcenter.bintray.com/commons-lang/commons-lang/2.3/commons-lang-2.3.jar: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target).
2018-05-22 16:08:52,519 [https-jsse-nio-8060-exec-12] [WARN ] (o.a.r.RemoteRepoBase:433) - jcenter: Error in getting information for 'commons-lang/commons-lang/2.2/commons-lang-2.2.jar' (Failed retrieving resource from http://jcenter.bintray.com/commons-lang/commons-lang/2.2/commons-lang-2.2.jar: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target).

认证路径错误很可能是由于通过SSL重定向到Bintray的CDN,而不管远程repo URL是http而不是https。如果您尝试使用cURL拉取此文件,您将看到它确实重定向到

服务器证书看起来很好,也就是说,我个人能够通过我的Artifactory实例和使用cURL(w/o)查看任何SSL验证错误来提取文件

也就是说,我们通常会看到这种类型的错误是由于以下几个主要原因造成的:

  • 有人(有时可能是您的it部门)在托管Artifactory的服务器上处理了JDK/JRE安装的“cacerts”文件。这个文件像浏览器一样保存一个可信CA列表,它告诉Java安装在启动SSL连接时哪些证书是可信的。当您尝试通过SSL连接到akamai.bintray.com或jcenter.bintray.com时,可以使用cURL或“openssl”检查该证书。这些证书由标准可信CA颁发
  • 这是不太常见的-但有时使用JDK供应商而不是主流供应商(如Oracle、openJDK等)需要使用过时/非标准的“cacerts”文件。当此类安装附带的“cacerts”文件不包含标准受信任CA的根证书时,您很可能会看到此错误
  • 更牵强的是,我看到了这种情况——您的连接是通过一个公司代理启动的,该代理促进了类似“ssl碰撞”的行为,或者表现为一个MITM,它试图通过提供一个模拟目标服务器证书的假证书来欺骗您的ssl流量,从而在客户端上导致ssl验证错误
    我希望这有帮助

    认证路径错误很可能是由于通过SSL重定向到Bintray的CDN,而不管远程回购URL是http而不是https。如果您尝试使用cURL拉取此文件,您将看到它确实重定向到

    服务器证书看起来很好,也就是说,我个人能够通过我的Artifactory实例和使用cURL(w/o)查看任何SSL验证错误来提取文件

    也就是说,我们通常会看到这种类型的错误是由于以下几个主要原因造成的:

  • 有人(有时可能是您的it部门)在托管Artifactory的服务器上处理了JDK/JRE安装的“cacerts”文件。这个文件像浏览器一样保存一个可信CA列表,它告诉Java安装在启动SSL连接时哪些证书是可信的。当您尝试通过SSL连接到akamai.bintray.com或jcenter.bintray.com时,可以使用cURL或“openssl”检查该证书。这些证书由标准可信CA颁发
  • 这是不太常见的-但有时使用JDK供应商而不是主流供应商(如Oracle、openJDK等)需要使用过时/非标准的“cacerts”文件。当此类安装附带的“cacerts”文件不包含标准受信任CA的根证书时,您很可能会看到此错误
  • 更牵强的是,我看到了这种情况——您的连接是通过一个公司代理启动的,该代理促进了类似“ssl碰撞”的行为,或者表现为一个MITM,它试图通过提供一个模拟目标服务器证书的假证书来欺骗您的ssl流量,从而在客户端上导致ssl验证错误
    我希望这会有所帮助

    现在我们通过删除jcenter并使用mavenlink解决了这个问题。但是当查看您的描述和我们的设置时,我们可能会遇到类似选项1的问题。稍后我们将对此问题有更详细的了解。@DannyvanZunderd欢迎联系support@jfrog.com如果你无法弄清这件事的真相。我们不希望您仅仅因为以下原因而不使用Jcenter:))因为现在我们通过删除Jcenter并使用mavenlink解决了这个问题。但是当查看您的描述和我们的设置时,我们可能会遇到类似选项1的问题。稍后我们将对此问题有更详细的了解。@DannyvanZunderd欢迎联系support@jfrog.com如果你无法弄清这件事的真相。我们不希望您仅仅因为以下原因而不使用Jcenter:))