【问题标题】:How to Fix SSL certificate error when want to push to GitHub using git bash?想要使用 git bash 推送到 GitHub 时如何修复 SSL 证书错误?
【发布时间】:2016-05-03 05:23:45
【问题描述】:

我正在尝试在 Windows 8 上使用 git bash 将一个简单的 Web 应用程序推送到 GitHub。但是当我执行 git push origin master 时,它会显示“致命:无法访问 'https://******** .com/****/******.git/': SSL 证书问题:无法获取本地颁发者证书”。

有人可以在不禁用 SSL 的情况下帮助我解决这个问题吗?

【问题讨论】:

  • ssl证书在Git目录下。

标签: git bash ssl github


【解决方案1】:

您可以通过提供 SSL 证书来修复错误。您可以通过以下任一方式执行此操作:

  • 编辑您的 Git 配置文件(在 Linux 中 ~/.gitconfig)并添加:

    [http]
        sslCAinfo = <path to your key>
    
  • 执行以下命令:

    git config --global http.sslCAinfo <path to your key>
    

【讨论】:

  • raviolicode,你是说我的证书在程序文件中。然后我必须输入 sslCAinfo = C:/ProgramFiles/certificate.crt 。然后 git config --global http.sslCAinfo C:/Program Files/certificate.crt 。对吗???
  • @Octtavius 只需要上述一项。例如:git config --global http.sslCAinfo &lt;path to your key&gt; 会将配置添加到您的~/.gitconfig,因此无需将该行添加到gitconfig 文件中。
  • 非常感谢您的详细解释!
猜你喜欢
  • 2014-06-12
  • 1970-01-01
  • 1970-01-01
  • 2023-03-16
  • 2022-06-13
  • 2013-10-25
  • 2016-12-30
  • 2017-12-11
  • 2015-10-28
相关资源
最近更新 更多