Search code examples
gitssl-certificategit-clone

git clone with http.sslVerify false for a specific URL does not work


My GitLab server has a self signed certificate. When I clone a repository I get

fatal: unable to access 'https://10.10.10.10.10/gitlab-instance-3b9321be/test.git/': Issuer certificate is invalid.

After running this command git config --global http.sslVerify false the clone completes successfully. I don't want to ignore certificates globally so I deleted my ~/.gitconfig file and ran this command git config --global --bool --add http.https://10.10.10.10.sslverify false. Now my ./gitconfig looks like this:

[http "https://10.10.10.10"]
    sslverify = false

git clone fails with the original error.

I'm running on RHEL 7.8 and my git version is 1.8.3.1. This should work based on other answers. What am I doing wrong?


Solution

  • This should work based on other answers.

    (What makes you believe that? It's not true. It would be true, except...)

    I'm running on RHEL 7.8 and my git version is 1.8.3.1.

    From the Git 1.8.5 release notes:

    * The "http.*" variables can now be specified for individual URLs.
      For example,
    
      [http]
          sslVerify = true
      [http "https://weak.example.com/"]
          sslVerify = false
    
      would flip http.sslVerify off only when talking to that specific
      site.
    

    Note that 1.8.5 > 1.8.3.1: your Git version is simply too old.