gpt4 book ai didi

带或不带 ssl 证书的 git

转载 作者:太空宇宙 更新时间:2023-11-03 13:00:54 26 4
gpt4 key购买 nike

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

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

这很好用。但是,我的许多项目都使用 bower,当我执行 bower install 时,bower 引发连接到 github 的 SSL 错误。如果我从配置中清除证书,Bower 就可以工作。

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

最佳答案

If I clear the certificate fform the config, bower works.

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

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


OP aquavitae添加 in the comments :

Not quite what I need because I'm on arch linux, but it pointed me in the right direction.
I needed to:

  • add my certificate to /etc/ca-certificates/trust-source/anchors and
  • run trust extract-compat

关于带或不带 ssl 证书的 git,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29822177/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com