【问题标题】:git with or without ssl certificates带或不带 ssl 证书的 git
【发布时间】:2015-04-23 11:32:13
【问题描述】:

我在带有自签名证书的服务器上运行 gitlab,并且我已将 git 配置为使用该证书

git config --global http.sslCAInfo path/to/cert.pem

这很好用。但是,我的一些项目使用 bower,当我使用 bower install 时,bower 会引发连接到 github 的 SSL 错误。如果我从配置中清除证书,bower 就可以了。

如何告诉 git 仅对我的 gitlab 域使用自签名证书,而对其他所有内容使用默认证书?

【问题讨论】:

    标签: git ssl ssl-certificate


    【解决方案1】:

    如果我从配置中清除证书,bower 可以工作。

    如果您清除它,Git 将在 <git>/bin/curl-ca-bundle.crt 中查找 CA(其中还包含 PEM 格式的 CA、Base64 编码的 ASCII 文件并包含“-----BEGIN CERTIFICATE-----”和“-----END CERTIFICATE-----”语句)。

    您可以简单地将您的证书附加到该文件,这将适用于所有遥控器。


    OP aquavitae 加了in the comments

    不是我需要的,因为我使用的是 arch linux,但它为我指明了正确的方向。
    我需要:

    • 将我的证书添加到 /etc/ca-certificates/trust-source/anchors
    • 运行trust extract-compat

    【讨论】:

    • 不是我需要的,因为我使用的是 arch linux,但它为我指明了正确的方向。我需要将我的证书添加到 /etc/ca-certificates/trust-source/anchors 并运行 trust extract-compat
    • @aquavitae 好的。为了提高知名度,我已将您的结论包含在答案中。
    猜你喜欢
    • 1970-01-01
    • 2013-10-28
    • 1970-01-01
    • 2016-07-08
    • 2019-03-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多