解决jcenter依赖项时handshake_failure

时间:2018-12-13 08:09:31

标签: java ssl gradle artifactory jcenter

使用版本4.10.2中的gradle(其中包装器设置为4.8.1),当前存在获取jcenter依赖项的问题。

例如gradle脚本中的这一行:

implementation 'org.jfrog.artifactory.client:artifactory-java-client-services:+'

构建项目会导致以下错误:

FAILURE: Build failed with an exception.

What went wrong:
Could not resolve all files for configuration ':compileClasspath'.
> Could not download artifactory-java-client-services.jar (org.jfrog.artifactory.client:artifactory-java-client-services:2.8.1)
  > Could not get resource 'https://jcenter.bintray.com/org/jfrog/artifactory/client/artifactory-java-client-services/2.8.1/artifactory-java-client-services-2.8.1.jar'.
      > Could not GET 'https://jcenter.bintray.com/org/jfrog/artifactory/client/artifactory-java-client-services/2.8.1/artifactory-java-client-services-2.8.1.jar'.
        > Received fatal alert: handshake_failure

即使使用浏览器,也无法解析以下URL以下载JAR:

https://jcenter.bintray.com/org/jfrog/artifactory/client/artifactory-java-client-services/2.8.1/artifactory-java-client-services-2.8.1.jar

Chrome显示以下内容:

ERR_SSL_VERSION_OR_CIPHER_MISMATCH

如果它失败了,我尝试了...好吧,解决方法是手动获取jar文件并将其上传到我们自己的maven代理或本地存储库中。这些可以在gradle脚本中引用。但这远非自动构建。

我该如何解决能够再次从jcenter获得依赖项的问题?

1 个答案:

答案 0 :(得分:0)

我将首先尝试找出问题所在。

  • 对于Chrome,您可能有办法解决更具描述性的错误。看起来好像是您计算机上安装的根证书中的问题。
  • 对于Gradle,我首先尝试使用一个简单的Java程序,例如this one,以查看来自Java的常规连接是否有效。然后,如果问题不在Java级别,我将上移。