[英]Jenkins Git integration - How to disable SSL certificate validation
[英]How to disable Jenkins checkout and git plugin SSL verify?
我在 K8s 節點中運行 Jenkins 代理。 我在 dockerfile 中添加了git config --global http.sslVerify false
。 我也在~/.gitconfig
中添加了~/.gitconfig
。 我嘗試在管道中使用 Jenkins checkout
和git
來獲取代碼,但出現以下錯誤:
stderr: fatal: unable to access 'https://gitlab-ops.prod.hccn/iac/gitops/vsphere_linux.git/': SSL certificate problem: unable to get local issuer certificate
但是如果我用sh git clone
命令替換它們,就可以了。
所以這里是我的問題:
git config --global http.sslVerify false
僅適用於git
命令,不適用於 Jenkins checkout
和git
,對嗎? 因為git
命令是 sh 命令,但是 Jenkins checkout
git
是某種 Java 插件?checkout
是否也參考了git
或gitclient
插件?checkout
和git
插件 SSL 驗證? 我在jenkins git-client 插件或jenkins git 插件或jenkins scm 插件上找不到它們補充:
git config --global http.sslVerify false
使用Jenkins Git 客戶端插件,我會避免使用 JGit(在此設置中設置)
我會:
git
位於 Jenkins 控制器(以前稱為“master”)的$PATH
中然后將強制執行全局設置http.sslVerify
。
雖然如此處所見,JGit 也應該能夠讀取相同的設置。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.