Jenkins Git集成-如何禁用SSL证书验证 [英] Jenkins Git integration - How to disable SSL certificate validation

查看:2402
本文介绍了Jenkins Git集成-如何禁用SSL证书验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从詹金斯(Jenkins)创建工作时,出现以下错误.如何在Jenkins中禁用证书验证?

I am getting the below error while creating a job from Jenkins. How do I disable certificate validation in Jenkins?

在Git Bash中,我可以使用git config --global http.sslVerify false命令禁用它,但不确定如何从Jenkins使用它.

From Git Bash I can use git config --global http.sslVerify false command to disable it, but not sure how to use it from Jenkins.

错误:

Failed to connect to repository : Command "C:\Program Files (x86)\Git\cmd\git.exe ls-remote -h url ofmy repository.git HEAD" returned status code 128:
stdout:
stderr: fatal: unable to access 'url of my git/': SSL certificate problem: self signed certificate in certificate chain

推荐答案

最好的选择是将自签名证书添加到您的证书存储区

Best option is to add the self-signed certificate to your certificate store

获取服务器证书树这可以使用chrome完成.

Obtain the server certificate tree This can be done using chrome.

  1. 导航到服务器地址.单击挂锁图标并查看证书.将所有证书链导出为base64编码文件(PEM)格式.

  1. Navigate to be server address. Click on the padlock icon and view the certificates. Export all of the certificate chain as base64 encoded files (PEM) format.

将证书添加到GIT信任配置文件的信任链中 在运行作业的计算机上的Git bash中,运行以下命令:

Add the certificates to the trust chain of your GIT trust config file In Git bash on the the machine running the job run the following:

"git config --list".

"git config --list".

找到http.sslcainfo配置,此配置显示证书信任文件所在的位置. 3.将所有证书(包括"- -BEGIN- -""- -END- -")复制到信任链文件中.确保将ROOT证书链添加到证书文件中

find the http.sslcainfo configuration this shows where the certificate trust file is located. 3. Copy all the certificates into the trust chain file including the "- -BEGIN- -" and the "- -END- -". Make sure you add the ROOT certificate Chain to the certificates file

这应该使用自签名证书和GIT解决您的问题.

This should solve your issue with the self-signed certificates and using GIT.

不推荐

另一种方法是远程进入您的奴隶并运行以下命令:

The other way is to remote into your slave and run the following:

git config --global http.sslVerify false

git config --global http.sslVerify false

这将保存到全局配置中,此实例从不进行SSL验证,不建议这样做,它仅应在测试时使用,然后再次禁用.应该按照上面的步骤正确地进行操作.

This will save into the global config that this instance never does SSL verification, this is NOT recommended, it should be used only when testing and then disabled again. It should be done properly as above.

这篇关于Jenkins Git集成-如何禁用SSL证书验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆