首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >告诉Git使用几个自签名证书作为受信任证书

告诉Git使用几个自签名证书作为受信任证书
EN

Stack Overflow用户
提问于 2018-07-05 20:04:34
回答 0查看 388关注 0票数 1

我在几个自签名证书下有几个git服务器。

我需要将所有证书添加为受信任证书。我知道flag http.sslCAInfo -它只适用于一个证书。我知道flag http.sslCAPath --但它根本不工作。

代码语言:javascript
复制
$ cat .gitconfig
...
[remote "origin"]
    url = https://[server_ip_address]/root/FirstOne.git
[http]
    sslCAPath = /Users/username/certs/
...
$ GIT_CURL_VERBOSE=1 git fetch
Couldn't find host [server_ip_address] in the .netrc file; using defaults
*   Trying [server_ip_address]...
* TCP_NODELAY set
* Connected to [server_ip_address] ([server_ip_address]) port 443 (#0)
* ALPN, offering http/1.1
* Cipher selection:     ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
*   CAfile: /etc/ssl/cert.pem
CApath: /Users/username/certs/
* SSL certificate problem: unable to get local issuer certificate
* stopped the pause stream!
* Closing connection 0
fatal: unable to access 'https://[server_ip_address]/root/FirstOne.git/': SSL certificate problem: unable to get local issuer certificate

正如我所看到的,CAFile有一个默认值,而且据我所知,CAFile的优先级低于CAPath。我曾尝试将变量GIT_SSL_CAINFO设置为空值,但得到了

代码语言:javascript
复制
error setting certificate verify locations:
CAfile:
CApath: /Users/username/certs/

我该如何解决这个问题?附注:请不要建议我使用http.sslVerify false :)

EN

回答

页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/51190877

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档