continuous-integration - VSTFS 构建错误 - SSL 证书问题:无法获取本地颁发者证书
问题描述
我是 CI 新手。我定义了一个构建。当我排队构建时出现以下错误:
2018-10-08T09:54:50.0136696Z ##[command]git config --get-all http.https://testurl.extraheader
2018-10-08T09:54:50.1425808Z ##[command]git config --get-all http.proxy
2018-10-08T09:54:50.2763750Z ##[command]git -c http.extraheader="AUTHORIZATION: bearer ********" fetch --tags --prune --progress --no-recurse-submodules origin
2018-10-08T09:54:51.1465256Z fatal: unable to access 'https://testdomain/tfs/Project/_git/Project.Test/': SSL certificate problem: unable to get local issuer certificate
2018-10-08T09:54:51.1719172Z ##[error]Git fetch failed with exit code: 128
解决方案
This error occurs when a self-signed certificate cannot be verified.
Here is the same issue discussed on GitHub : https://github.com/Microsoft/azure-pipelines-agent/issues/688
You can try below workarounds:
- Add Enterprise CA certificate to
git config –global http.sslCAInfo
. Tell Git where to find the CA bundle by running:
git config --system http.sslCAPath /absolute/path/to/git/certificates
- Modify the
ca-bundle.crt
file to include the domain's root cert which found in the<agent install directory>\externals\git\mingw64\ssl\certs
folder. Turn off sslVerify with:
git config --system http."https://our.internal:port/".sslVerify false
- Try following the tutorial which mentioned in below blog: https://blogs.msdn.microsoft.com/phkelley/2014/01/20/adding-a-corporate-or-self-signed-certificate-authority-to-git-exes-store/
Try to deploy an new agent using the release 2.129.0 agent which contains git SChannel support.
To enable git to use
SChannel
, you need to pass--gituseschannel
during agent config. ex:./config.cmd --gituseschannel
You can also reference the solutions mentioned in this thread: SSL certificate problem: Unable to get local issuer certificate
推荐阅读
- x86 - UEFI 引导加载程序中的 SPI 寄存器读写应用程序
- visual-studio - 使用 VS 2017 中的 cl.exe 编译 arm 或 arm64 程序时缺少 mspdbcore.dll
- swagger-ui - Swagger UI 的 requestInterceptor 中的 Promise
- react-native - 为什么使用 this.setState 会导致超过最大更新深度?
- javascript - Javascript 未显示所需的值
- mysql - 如何从别名中找到mysql中的总数(总和)?
- java - 使用BLE同步多个设备的时间
- sql - SQL批量复制:触发器没有被触发
- reactjs - 浅层和装载包装器中的酶模拟有什么区别?
- python - 用于名称标准化的 Python RegEx