【问题标题】:maven is "unable to find valid certification path to requested target" - letsencrypt ssl certificatemaven 是“无法找到请求目标的有效证书路径”-letsencrypt ssl 证书
【发布时间】:2017-09-19 09:39:52
【问题描述】:

我最近为我的 maven 存储库(Apache 代理背后的 Artifactory)切换到 letsencrypt 证书。通过浏览器访问 repo 工作正常,证书没有问题(截图如下)。

如果我 import the certificate manually into the java keystore 也可以。

但根据这个 SO 问题,Java should accept letsencrypt certificates starting with 8u101

我总是遇到这个异常:

sun.security.validator.ValidatorException:
PKIX path building failed:
sun.security.provider.certpath.SunCertPathBuilderException:
unable to find valid certification path to requested target -> [Help 1]

C:\myproject>mvn -version
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T17:41:47+01:00)
Maven home: C:\maven
Java version: 1.8.0_112, vendor: Oracle Corporation
Java home: C:\jdk1.8_win64\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "amd64", family: "dos"

【问题讨论】:

    标签: apache maven ssl lets-encrypt


    【解决方案1】:

    终于弄明白了,3个月后...

    maven artifactory 存储库前面的 apache 服务器未配置为提供链中的中间证书。

    我下载了中间证书 - Let’s Encrypt Authority X3 (IdenTrust cross-signed) - 并配置了 apache 来提供它。

    实际上,domain.crt 文件包含域和中间证书,对于我所有的测试浏览器来说,这总是足够好的。但是那台机器上的 eclipse/maven 设置无法处理它。

    SSL Labs check 告诉我证书链不完整(尽管似乎没有浏览器关心)之后,我才开始查看 apache 配置。

    之前:

      SSLEngine On
      SSLCertificateFile "path/to/domain.crt"
      SSLCertificateKeyFile "path/to/domain.key"
    

    之后:

      SSLEngine On
      SSLCertificateFile "path/to/domain.crt"
      SSLCertificateKeyFile "path/to/domain.key"
      SSLCertificateChainFile "path/to/letsencrypt-authority-x3-identrust.pem"
    

    【讨论】:

    • 这个答案帮了大忙——谢谢!请注意,letsencrypt bot 应该默认为您下载此文件,并将其存储在/etc/letsencrypt/live/$DOMAIN/chain.pem。根据您的回答,使用此文件更新我的配置,为我解决了这个问题。
    猜你喜欢
    • 2014-05-26
    • 1970-01-01
    • 2013-05-24
    • 1970-01-01
    • 2020-11-11
    • 2011-10-18
    • 2020-09-14
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多