Git: http.sslVerify false global but only for specific remote

17,133

Solution 1

In the gitconfig you can specify for each remote address both proxy and sslVeryfy like this:

no proxy and sslVerify false

[http "https://blah.com/"]
    sslVerify = false
    proxy =

and also for all the others proxy and sslVerify false

[http]
    sslVerify = false
    proxy = http://yourproxyaddress.com:8080

Solution 2

In case anyone else stumbles upon this, the way to set http.sslVerify for a specific remote from command line would be:

git config --global http.<remote name>.sslVerify false

e.g.

git config --global http.https://gitlab.domain.com/.sslVerify false
Share:
17,133
lumen
Author by

lumen

Updated on June 14, 2022

Comments

  • lumen
    lumen about 2 years

    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:

    • 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:

    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 "" (in this case for a direct connection)

    Unfortunately something like the following does not work:

    git config --global remote.<remote name>.http.sslVerify false

    Any ideas? Thanks and regards!