簡體   English   中英

Jenkins 無法訪問本地 github 存儲庫

[英]Jenkins unable to access on-prem github repository

如何從 jenkins 訪問本地 github? 我收到 Peer's Certificate 錯誤。

git clone https://abcd.efgh.ijk.state.ih.us/DataLake/project.git Cloning into 'project'... fatal: unable to access 'https://abcd.efgh.ijk.state.ih.us/DataLake/project.git/': Peer's Certificate issuer is not recognized.

為了測試,我可以通過 ssh 進入機器,並且在我設置git config --global http.sslverify false之后我可以 git clone ,然后它會提示我提供用戶名和密碼。 但我需要 Jenkins 才能克隆它。

在閱讀了有關添加 SSL 證書的其他帖子后,我嘗試了

openssl s_client -CApath /etc/ssl/certs/ -connect abcd.efgh.ijk.state.ih.us:443

響應看起來像這樣

CONNECTED(00000003) depth=0 XXXXXXXXXXXXXXX verify error:num=20:unable to get local issuer certificate verify return:1 depth=0 XXXXXXXXXXXXXXX verify error:num=21:unable to verify the first certificate verify return:1 Certificate chain 0 s:xxxxxxxx i:xxxxxxxx Server certificate -----BEGIN CERTIFICATE----- YYYY/.... .... -----END CERTIFICATE----- subject=xxxxxxxx issuer=xxxxxx No client certificate CA names sent Peer signing digest: SHA512 Server Temp Key: ECDH, P-256, 256 bits SSL handshake has read 2557 bytes and written 415 bytes

New, TLSv1/SSLv3, Cipher is ..... Server public key is 2048 bit Secure Renegotiation IS supported Compression: NONE Expansion: NONE No ALPN negotiated SSL-Session: Protocol : TLSv1.2 Cipher : ....... Session-ID: ....... Session-ID-ctx: Master-Key: .................. Key-Arg : None Krb5 Principal: None PSK identity: None PSK identity hint: None Start Time: 1565710526 Timeout : 300 (sec) Verify return code: 21 (unable to verify the first certificate) --- closed

這可能是由於 SSL 鏈不完整(如此處

如果其他otherdomain可以從 Internet 訪問,您可以使用ssllabs.com/ssltest進行分析(以防存在TLS 配置問題
您可以通過whatsmychaincert.com獲取鏈證書

您需要將這些添加到Jenkins JVM trustore 中

檢查您的代理服務器設置以及 git/opnssl 設置也是一個好主意。 它僅通過更新最新的代理地址就解決了我的問題。

暫無
暫無

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

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