通过 artifactory remote-simple 存储库拉取 gradle distributionUrl 结果 javax.net.ssl.SSLHandshakeException
Pulling gradle distributionUrl through artifactory remote-simple repository results in javax.net.ssl.SSLHandshakeException
如何告诉 gradle 包装器信任我的人工制品的证书而不修改每台使用它的机器,或者我是否以错误的方式通过人工制品?
我的人工制品使用自签名证书,我的系统设置为信任它。在 gradle 构建中,访问 artifactory repos 对我的依赖项非常有效,但 gradlew 不太如此。
为了提高构建可靠性,我们为 https://services.gradle.org/distributions/gradle-... 添加了一个人工简单远程存储库,但在构建时会看到以下内容:
gradle-wrapper.properties
distributionUrl=https\://artifactory01.megacorp.us/remote-simple-artifactory/distributions/gradle-4.0.2-all.zip
错误
Exception in thread "main" 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
看起来 gradlew 确实将 artifactory 视为中间人(本质上是这样)。
正确的做法是什么?
错误是因为运行 Artifactory 的 JAVA 没有远程 URL 的根证书在其受信任的根证书存储中受信任。
此外,关于PKIX,请参考以下knowledge base article。
一个附加选项,以防您的 URL 末尾有一个尾随“/”,这可能导致重定向到远程存储库的安全位置
如何告诉 gradle 包装器信任我的人工制品的证书而不修改每台使用它的机器,或者我是否以错误的方式通过人工制品?
我的人工制品使用自签名证书,我的系统设置为信任它。在 gradle 构建中,访问 artifactory repos 对我的依赖项非常有效,但 gradlew 不太如此。
为了提高构建可靠性,我们为 https://services.gradle.org/distributions/gradle-... 添加了一个人工简单远程存储库,但在构建时会看到以下内容:
gradle-wrapper.properties
distributionUrl=https\://artifactory01.megacorp.us/remote-simple-artifactory/distributions/gradle-4.0.2-all.zip
错误
Exception in thread "main" 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
看起来 gradlew 确实将 artifactory 视为中间人(本质上是这样)。
正确的做法是什么?
错误是因为运行 Artifactory 的 JAVA 没有远程 URL 的根证书在其受信任的根证书存储中受信任。
此外,关于PKIX,请参考以下knowledge base article。
一个附加选项,以防您的 URL 末尾有一个尾随“/”,这可能导致重定向到远程存储库的安全位置