2017-06-14 165 views

回答

0

您可能需要將您的證書頒發機構證書添加到java keytool。

如果您在詹金斯看日誌,發現是這樣的:

org.kohsuke.github.HttpException: Server returned HTTP response code: -1, message: 'null' for URL: https://github.xxx.com/api/v3/user 

向下滾動,看看是否有這樣一行:

Caused by: 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 

此錯誤是說,SSL與有關PKIX路徑/ certpath的握手失敗。嘗試添加您的CA Cert到keytool並重新啓動Jenkins以查看是否有幫助。

Here's the post幫助我用keytool修改java證書。 (默認keytool密碼是「changeit」)

0

看來你的java cacerts沒有正確的證書給你的git URL。你可以嘗試以下步驟。

步驟1:取得的https://www.google.com

  1. 打開https://www.google.com根證書中鉻的瀏覽器。
  2. 選擇從上下文菜單(右鍵點擊頁面上)檢查並導航到安全標籤
  3. 點擊查看證書
  4. 點擊最上面的證書層次結構,並確認它是用尾巴根CA短語。
  5. 拖放您在桌面上看到書面證書的圖像。

那就是它!你有你的根證書!

第2步:安裝證書到Java cacerts的

請確認您有系統變量JAVA_HOME聲明,你將執行上只有JRE cacerts的這些步驟!

  1. 導航到cacerts中由JAVA_HOME/JRE/lib/security中/ cacerts的
  2. 下載並安裝密鑰工具資源管理器是適用於所有平臺
  3. 在工具和進口cetificate開放cacerts中的「導入受信任的證書」按鈕。
  4. 保存更改(你可能會遇到問題,如果它是Mac和你沒有寫訪問!)

第3步:重新啓動詹金斯

你不應該得到SSL握手的問題現在開始。