git - SSL 证书问题:无法获取本地颁发者证书,Jenkins 中的 git clone/pull
问题描述
我们有一个 Jenkins 构建作业,它执行了一个执行 git clone/pull 的 ANT 目标(我们没有使用 Jenkins Git 插件)。
<macrodef name="git">
<attribute name="command" />
<attribute name="dir" default="" />
<element name="args" optional="true" />
<sequential>
<echo message="git @{command}" />
<exec executable="git" dir="@{dir}">
<arg value="@{command}" />
<args/>
</exec>
</sequential>
</macrodef>
<macrodef name="git-clone-pull">
<attribute name="repository" />
<attribute name="dest" />
<sequential>
<git command="clone">
<args>
<arg value="@{repository}" />
<arg value="@{dest}" />
</args>
</git>
<git command="pull" dir="@{dest}" />
</sequential>
</macrodef>
<target name="clone-pull-git-repository">
<echo message="# Cloning '${git.repository}':" />
<git-clone-pull
repository="https://${git.user}:${git.password}@${git.repository.url}/grsbrms/${git.repository}"
dest="${git.repository.dir}/${git.repository}" />
</target>
在最近的 Bitbucket 迁移之后,我们看到了以下错误。
[echo] git pull
[exec] fatal: unable to access 'https://TestUser:xyz@bitbucket.somecorp.com/scm/grs-brms-payroll-xom/': SSL certificate problem: unable to get local issuer certificate
我们尝试将 ssl 证书从网站导入 JVM:
keytool -import -alias SV12345 -keystore %JAVA_HOME%\jre\lib\security\cacerts -file C:\Temp\bitbucket.cer
并且还将证书添加到 Jenkins 启动脚本中:
-Djavax.net.ssl.trustStore=%JENKINS_HOME%\.cacerts\cacerts
-Djavax.net.ssl.trustStorePassword=changeit
是否可以在不关闭 git 系统范围的 SSL 验证的情况下解决此问题?
即 git config --system http.sslVerify false
谢谢
解决方案
推荐阅读
- python - 过滤字典“喜欢”字符串
- csv - 在 hive 的一列中加载具有“(双引号)的管道分隔 CSV 数据
- javascript - Nextjs 从父目录导入外部组件
- php - 未定义的索引:第 1001 行的 client_id"
- java - 使用 PDFBox 展平 pdf 中的黑框
- mysql - 从 2 个 mySQL 表中获取数据
- javascript - Express.js UnhandledPromiseRejectionWarning:未处理的承诺拒绝
- jmeter - 如何在 HTTP 授权管理器中加密密码参数 - JMETER
- javascript - TextDecoder iso-8859-1:Fatal javascript OOM in In Effective mark-compacts near heap limit
- reactjs - Framer / React:无法更改文本输入 onClick / onChangePage 的焦点状态