Git:http.sslVerify false全局,但仅适用于特定的远程 [英] Git: http.sslVerify false global but only for specific remote
问题描述
我正在寻找一种方法,以全局禁用Git SSL验证,但仅限于单个遥控器.
I'm looking for a way, to disable the Git SSL verification globally but for a single remote only.
我所知道的唯一方法就是这两个可能性:
The only ways I know about, are these two possibilies:
- 针对所有远程服务器全局执行:
git config --global http.sslVerify false
- 在每个远程仓库中本地执行:
git config --local http.sslVerify false
- Do it globally, for all remotes:
git config --global http.sslVerify false
- Do it locally in every single remotes repo:
git config --local http.sslVerify false
但是是否有机会像使用代理设置一样设置配置?例如:
But is there a chance to set the config like you can do it with proxy settings? For example:
我的~/.gitconfig
中有一个系统范围的代理设置.但是,我没有使用本地代理设置覆盖它,而是使用:
I have a system wide set proxy config in my ~/.gitconfig
. But instead of overriding it by a local proxy setting, I used:
git config --global remote.<remote name>.proxy ""
(在这种情况下为直接连接)
git config --global remote.<remote name>.proxy ""
(in this case for a direct connection)
不幸的是,以下内容不起作用:
git config --global remote.<remote name>.http.sslVerify false
有什么想法吗?谢谢和问候!
Any ideas? Thanks and regards!
推荐答案
在gitconfig中,您可以为每个远程地址指定代理和sslVeryfy,如下所示:
In the gitconfig you can specify for each remote address both proxy and sslVeryfy like this:
没有代理并且sslVerify为假
no proxy and sslVerify false
[http "https://blah.com/"]
sslVerify = false
proxy =
,还有其他所有代理,并且sslVerify为false
and also for all the others proxy and sslVerify false
[http]
sslVerify = false
proxy = http://yourproxyaddress.com:8080
这篇关于Git:http.sslVerify false全局,但仅适用于特定的远程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!