gpt4 book ai didi

git - 在 git 中同时使用自签名和受信任的证书

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

我使用自签名证书设置自己的 git 服务器。我的 .gitconfig 看起来像这样

[credential]
helper = wincred
[http]
sslCAInfo = path-to-my-certificate

它正在为我自己的 git 服务器工作。但是,当我克隆另一个 https git 存储库时出现错误

fatal: unable to access     
'https://url-of-git': SSL certificate problem: unable to get local issuer certificate

在我删除 ssl 配置后它工作正常。

同时使用自签名证书和受信任证书应该如何解决?感谢您的任何建议。

顺便说一句:我已经在 windows 7 和 ubuntu 12.04 上测试过它,但出现了类似的错误。

最佳答案

您可以为您的服务器设置您的 sslCAInfo

git config http.https://yourserver.sslCAInfo path-to-my-certificate

这将给出如下配置:

[http "https://yourserver"]
sslCAInfo = path-to-my-certificate

该路径仅在您使用具有特定 url 的 Remote 时适用。

参见 git config更多:

http.<url>.*

Any of the http.* options above can be applied selectively to some URLs. For a config key to match a URL, each element of the config key is compared to that of the URL

关于git - 在 git 中同时使用自签名和受信任的证书,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33471141/

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