2017-04-22 133 views
5

我最近切換到letsencrypt證書我的Maven的回購協議(後面Apache代理Artifactory的)。通過瀏覽器進行的Repo訪問工作正常,證明沒有證書問題(截圖如下)。Maven是「無法找到有效的認證路徑要求的目標」 - letsencrypt SSL證書

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

但根據這太問題,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] 

enter image description here

enter image description here

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" 

回答

1

終於想通了,3個月後...

Apache服務器中maven artifactory repositor的前面y未配置爲提供鏈中的中間證書。

我下載的中間證書 - 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" 
相關問題