簡體   English   中英

Jenkins git 插件:無法識別 Peer 的證書頒發者

[英]Jenkins git plugin: Peer's Certificate issuer is not recognized

在嘗試連接到通過 https 托管的存儲庫時,我在使用 jenkins git 插件時遇到了問題。

Baue in Arbeitsbereich /opt/jenkins/jobs/TestJob2/workspace
 > git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
 > git config remote.origin.url https://my.host.de/group/project # timeout=10
Fetching upstream changes from https://my.host.de/group/project
 > git --version # timeout=10
using GIT_ASKPASS to set credentials Jenkins at my.host.de
 > git fetch --tags --progress https://my.host.de/group/project +refs/heads/*:refs/remotes/origin/*
ERROR: Error fetching remote repo 'origin'
hudson.plugins.git.GitException: Failed to fetch from https://my.host.de/group/project
    at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:766)
    at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1022)
    at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1053)
    at hudson.scm.SCM.checkout(SCM.java:485)
    at hudson.model.AbstractProject.checkout(AbstractProject.java:1269)
    at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:607)
    at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:529)
    at hudson.model.Run.execute(Run.java:1738)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:98)
    at hudson.model.Executor.run(Executor.java:410)
Caused by: hudson.plugins.git.GitException: Command "git fetch --tags --progress https://my.host.de/group/project +refs/heads/*:refs/remotes/origin/*" returned status code 128:
stdout: 
stderr: fatal: unable to access 'https://my.host.de/group/project/': Peer's Certificate issuer is not recognized.

    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1709)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1438)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:63)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:314)
    at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:764)
    ... 11 more
ERROR: null
Finished: FAILURE

我無法使用 SSH。 證書沒問題,一切看起來都很棒。

curl -Lv不顯示任何錯誤。

通過 ssh 登錄時,我可以在本地計算機上克隆存儲庫,也沒有錯誤消息。

我必須改變的開關在哪里?

當用戶 jenkins 正在運行時,我可以在將 git 屬性http.sslVerify設置為 false 時更改此行為,但這只是一種解決方法。

我只花了一個小時調查這個問題。 我測試的是,在master上,一切都很好,自定義CA被配置到系統中。 遺憾的是,我花了一些時間才意識到所有從屬設備都需要安裝適當的gitconfig或CA證書才能正常工作。

我解決了將sslCAInfo信息添加到.gitconfig文件的問題,如下所示:

$ echo -e "[http]\n\tsslCAInfo = /FOLDER_OF_CERTIFICATE/ca.pem" >> /var/lib/jenkins/.gitconfig

我正在使用 openshift ......我這樣做是為了主人和奴隸

檢查您的代理服務器設置以及其他 git/openssl 選項也是一個好主意。 它幫助我通過更新正確的代理設置來解決這個問題。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM