git - 特定服务器的 http.sslCAInfo 证书的正确 .gitconfig 语法是什么?

标签 git https certificate self-signed git-config

我正在通过 https 使用远程 git 存储库,它有一个自签名证书。为了让 git 知道自签名证书,我的 .gitconfig 中有以下内容:

[http]
sslCAInfo = /home/user/myselfsigned.cert

这工作正常,但是当我添加另一个带有 CA 签名证书的远程服务器时,git(或 curl?)也错误地尝试使用该远程服务器的证书文件。将证书应用于特定 Remote 的正确语法是什么?

最佳答案

我认为that question也回答了你的问题:

git config http."https://code.example.com/".sslCAInfo <downloaded certificate>.pem

gitconfig 文件会像这样:

[http "https://code.example.com/"]
    sslCAinfo = /path/to/<downloaded certificate>

虽然它对我还不起作用......

关于git - 特定服务器的 http.sslCAInfo 证书的正确 .gitconfig 语法是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23293417/

相关文章:

django - 从 https 重定向到 https 不起作用。找不到服务器,nginx

node.js - 我们如何在 https.agent 中设置 SSL 证书密码?

android - 如何将可信证书添加到 OkHttp

javascript - 获取 http/https 协议(protocol)以匹配 maps.google.com 的 &lt;iframe&gt;

iPhone 在具有不同帐户的多台计算机上使用相同的证书

tomcat - SSL fatal error ,握手失败 40

使用 Heroku 的 Git 子模块

git stash 无法刷新,如何只 pop 一些文件

git - Jenkins - 未加载 git 全局配置

git - 如何使 .gitignore 忽略没有扩展名的编译文件?