You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Gitea Webhook与Jenkins集成问题:HTTP 404及HTTPS证书验证失败

配置Gitea Webhook与Jenkins集成的问题

已添加Gitea Webhook,URL为https://my_jenkins_url/generic-webhook-trigger/invoke?token=gitea-webhook,触发条件为Main分支的Push事件。目前Gitea能触发Webhook,但无法启动Jenkins任务,遇到以下两类问题:

一、使用HTTP时返回404错误

错误内容:

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL was not found on this server.</p>
</body></html>

对应的POST请求详情:

Request URL: http://my_jenkins_url/generic-webhook-trigger/invoke?token=gitea-webhook
Request method: POST
Content-Type: application/json
X-GitHub-Delivery: ba7cf69c-68b4-49c7-8b67-13db7a963de8
X-GitHub-Event: push
X-GitHub-Event-Type: push
X-Gitea-Delivery: ba7cf69c-68b4-49c7-8b67-13db7a963de8
X-Gitea-Event: push
X-Gitea-Event-Type: push
X-Gitea-Signature: 
X-Gogs-Delivery: ba7cf69c-68b4-49c7-8b67-13db7a963de8
X-Gogs-Event: push
X-Gogs-Event-Type: push
X-Gogs-Signature: 
X-Hub-Signature: sha1=
X-Hub-Signature-256: sha256=

二、使用HTTPS时出现证书验证错误

错误信息:

Delivery: Post "https://my_jenkins_url/generic-webhook-trigger/invoke?token=gitea-webhook": tls: failed to verify certificate: x509: certificate is not valid for any names, but wanted to match my_jenkins_url

已知正常情况

直接在浏览器、Jenkins内部或通过Postman调用该HTTPS URL可正常触发Jenkins任务。

已完成的Jenkins配置

  • 已配置Git源码管理,仓库URL为https://gitea-url.your.org/username/repo.git
  • 已勾选无定时计划的Poll SCM选项

内容的提问来源于stack exchange,提问作者TheCoderGuy

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.21 00:50:02