首页 > 解决方案 > Jenkins 无法访问本地 github 存储库

问题描述

如何从 jenkins 访问本地 github?我收到对等证书错误。

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 clone git config --global http.sslverify false,然后它会提示我提供用户名和密码。但我需要詹金斯能够克隆它。

在阅读了有关添加 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

标签: gitssljenkinsopenssl

解决方案


这可能是由于 SSL 链不完整(如这里

如果otherdomain可以从 Internet 访问,您可以使用它进行分析ssllabs.com/ssltest(如果存在TLS 配置问题
并且您可以通过以下方式获取链式证书whatsmychaincert.com

您需要将它们添加到Jenkins JVM trustore


推荐阅读