我在几个自签名证书下有几个git服务器。
我需要将所有证书添加为受信任证书。我知道flag http.sslCAInfo -它只适用于一个证书。我知道flag http.sslCAPath --但它根本不工作。
$ 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设置为空值,但得到了
error setting certificate verify locations:
CAfile:
CApath: /Users/username/certs/我该如何解决这个问题?附注:请不要建议我使用http.sslVerify false :)
https://stackoverflow.com/questions/51190877
复制相似问题