Jenkins git plugin SSL验证修复

升级Jenkins的git和git client插件后,通过HTTPS访问Git仓库遇到SSL验证错误。解决方法包括编辑Jenkins配置文件,重启服务,启用untrustedSSL,以及由于JENKINS-22675的bug,最终转向使用SSH配置:创建凭证填充私钥,启用部署密钥,和在Jenkins作业中配置使用SSH协议和私钥。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

最近在将Jenkins内部使用的git和git client两个plugin分别升级到2.2(from 1.4), 1.9.1以后,git plugin 用https访问 git repo报错:

> git --version
using GIT_SSH to set credentials 
ERROR: Error cloning remote repo 'origin'
hudson.plugins.git.GitException: com.ibm.jsse2.util.j: PKIX path building failed: java.security.cert.CertPathBuilderException: PKIXCertPathBuilderImpl could not build a valid CertPath.; internal cause is: 
	java.security.cert.CertPathValidatorException: The certificate issued by CN=IBM Internal Root CA, O=International Business Machines Corporation, C=US is not trusted; internal cause is: 
	java.security.cert.CertPathValidatorException: Certificate chaining error
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.checkCredentials(CliGitAPIImpl.java:1982)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1143)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$200(CliGitAPIImpl.java:87)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:257)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$2.execute(CliGitAPIImpl.java:413)
	at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:153)
	at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:146)
	at hudson.remoting.UserRequest.perform(UserRequest.java:118)
	at hudson.remoting.UserRequest.perform(UserRequest.java:48)
	
您好!要在Jenkins 2.346中集成GitLab的Webhook,您可以按照以下步骤进行操作: 1.Jenkins中安装GitLab插件:进入Jenkins的插件管理页面,在“可选插件”选项卡下搜索并安装“GitLab Plugin”。 2. 配置Jenkins系统设置:进入Jenkins的系统管理页面,找到“GitLab”部分。在“GitLab服务器”中点击“添加GitLab服务器”,填写GitLab服务器URL和凭证(可以使用访问令牌或用户名/密码)。 3. 创建Jenkins项目:在Jenkins主页上创建一个新的自由风格或流水线项目。 4. 配置项目的源码管理:在项目配置页面中,选择Git作为源码管理,并填写您的Git仓库URL。 5. 配置Webhook:在GitLab中打开您的项目,进入“设置” -> “集成” -> “Webhooks”。在URL字段中输入您的Jenkins服务器URL,并选择要触发的事件类型(例如Push事件)。确保勾选“启用SSL验证”选项(如果您的Jenkins服务器启用了SSL)。 6. 测试Webhook:保存Webhook配置后,尝试在GitLab中进行一次Push操作,确保Jenkins能够接收到推送事件并触发构建。 7. 配置构建触发器:回到Jenkins项目的配置页面,可以根据需要配置构建触发器,例如使用GitLab的Branch或Tag名称作为触发条件。 完成以上步骤后,您的Jenkins项目将能够通过GitLab的Webhook来触发构建。请根据您的具体需求进行进一步的配置和调整。希望对您有所帮助!如有任何问题,请随时提问。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值