Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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!

like image 346
lumen Avatar asked Jun 29 '16 14:06

lumen


People also ask

What is sslVerify false?

git config — — global http.sslVerify false This error occur when self-signed certificate cannot be verified. By default the git verifies the self-signed certificate every time you push or pull the fixes to and from git server.

How do I bypass SSL in git?

Prepend GIT_SSL_NO_VERIFY=true before every git command run to skip SSL verification. This is particularly useful if you haven't checked out the repository yet. Run git config http. sslVerify false to disable SSL verification if you're working with a checked out repository already.


2 Answers

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
like image 84
Vera Stoyanova Avatar answered Oct 30 '22 02:10

Vera Stoyanova


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
like image 24
scrthq Avatar answered Oct 30 '22 03:10

scrthq