git - 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
解决方案
这可能是由于 SSL 链不完整(如这里)
如果otherdomain
可以从 Internet 访问,您可以使用它进行分析ssllabs.com/ssltest
(如果存在TLS 配置问题)
并且您可以通过以下方式获取链式证书whatsmychaincert.com
您需要将它们添加到Jenkins JVM trustore。
推荐阅读
- arrays - 在数组中查找特定数字的数组程序
- c# - 在 .NET 中反序列化 JSON 响应时处理空字典
- php - 大量表的 Phpmyadmin 500 内部服务器错误
- python-3.x - 您对在错误时间调用的函数使用什么错误类型?
- android - 如何在 RecyclerView 适配器中为 TextView 充气?
- java - IndexOutOfBoundsException:索引:0,大小:0
- android - Firebase 云消息服务无法实例化服务 FCM.MessagingService
- html - CSS3 平滑动画更改背景图像
- c++ - 仅在调试模式下向量解除分配期间从 dll in_ASSERTE(__acrt_first_block == header) 断言
- python - Concurrent.futures 在命令行中运行良好,而不是在使用 pyinstaller 编译时