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

Visual Studio中Git推送SSL证书错误求助:无法获取本地颁发者证书

Fixing Git SSL Certificate Error: Unable to Get Local Issuer Certificate for Azure DevOps

Hey there, let's work through this SSL certificate issue you're facing when pushing to your Azure DevOps Git repo. It's weird that your browser and Visual Studio can connect just fine but Git throws this error—usually, this happens because Git isn't using the same trusted certificate store as those apps. Here are a few solid fixes to try:

Since Visual Studio and your browser rely on Windows' built-in certificate store, you can tell Git to do the same with this command:

git config --global http.sslBackend schannel

This makes Git use the Windows Secure Channel API instead of its own OpenSSL setup, so it'll automatically trust the certificates your system already recognizes. No need to manually copy any certs!

2. Manually Import the Root CA Certificate

If the first fix doesn't work, you can explicitly tell Git to trust the root certificate from your Azure DevOps server:

  • Open your browser, navigate to your Azure DevOps repo URL, and click the lock icon in the address bar.
  • View the certificate details, find the root CA certificate (the top-level one in the certificate chain), and export it as a Base64-encoded .crt file.
  • Run this command, replacing the path with where you saved your exported cert:
    git config --global http.sslCAInfo "C:/Users/YourName/Documents/root-cert.crt"
    
    (Use forward slashes or double backslashes for Windows paths to avoid issues.)

If you just need to push a change quickly and can't fix the cert issue right away, you can turn off SSL verification temporarily. Note: This is insecure and should only be used for testing!

git config --global http.sslVerify false

Once your push goes through, remember to re-enable verification with:

git config --global http.sslVerify true

Check Your Git SSL Configuration

To confirm your changes took effect, run this command to see all global SSL-related settings:

git config --list --global | grep ssl

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.14 07:36:50