Github: error cloning my private repository

188,797

Solution 1

I have seen this on Windows, with msysgit 1.7.2.3. You have to fix the path to bin/curl-ca-bundle.crt. I had to specify the absolute path, using back-slashes:

git config --system http.sslcainfo "C:\Program Files (x86)\git\bin\curl-ca-bundle.crt"

This will result in changes to [git-install-dir]/etc/gitconfig file, which may be edited directly, too.

(Original solutions found at http://github.com/blog/642-smart-http-support)

Solution 2

I solved the problem installing the Git from: https://git-for-windows.github.io/ Locate the cert file path:

D:\Program Files\Git\mingw64\ssl\certs\ca-bundle.crt

Configure the Git path:

git config --system http.sslcainfo "D:\Program Files\Git\mingw64\ssl\certs\ca-bundle.crt"

Try again

Solution 3

If you use MSYS2...

Just install the certificate packages with the following commands:

32 bits

pacman -S mingw-w64-i686-ca-certificates ca-certificates

64 bits

pacman -S mingw-w64-x86_64-ca-certificates ca-certificates

Solution 4

If you were using Cygwin, you might install the ca-certificates package with apt-cyg:

wget rawgit.com/transcode-open/apt-cyg/master/apt-cyg
install apt-cyg /usr/local/bin
apt-cyg install ca-certificates

How do I install a cygwin package from the command line?

Solution 5

git config --global http.sslverify "false" 

Will solve the problem. After that a Pop-up window appears to enter your username and password

Share:
188,797

Related videos on Youtube

Mot
Author by

Mot

Updated on June 17, 2021

Comments

  • Mot
    Mot almost 3 years

    I'm trying to clone my GitHub project using the https-URL, but it fails with an error:

    $ git clone https://[email protected]/foo/foo-private.git
    Cloning into foo-private...
    Password:
    error: error setting certificate verify locations:
      CAfile: /bin/curl-ca-bundle.crt
      CApath: none
     while accessing https://[email protected]/foo/foo-private.git/info/refs
    
    fatal: HTTP request failed
    

    What am I doing wrong?

  • bvj
    bvj almost 9 years
    Plus One. Thanks. Don't recall having to do this msys2 32bit, but the circumstances might differ.
  • Peanut
    Peanut almost 9 years
    You should explain what this command does and why this helps. Posting raw commands without explanation is not a good idea, specially if you need root access.
  • FabienRohrer
    FabienRohrer almost 9 years
    Thank you, I confirm this is the thing to do using msys2 64 bits :-D
  • Daniel YC Lin
    Daniel YC Lin over 8 years
    It may occurs the /usr/ssl/certs/ca-bundle.crt file is empty, just re-install ca-certificates again
  • Victor
    Victor over 8 years
    In my case I needed to use the directory delimiter for windows, i mean, i have to use the "\" (windows) instead of "/" (unix) for separating directories in the path.
  • Ben Collier
    Ben Collier over 8 years
    For what it's worth, uninstalling and reinstalling GitHub Desktop fixed this for me too, despite it still using the AppData folder.
  • AXO
    AXO over 8 years
    I got error: could not lock config file C:\Program Files\Git\mingw64/etc/gitconfig: Permission denied. Ran "C:\Program Files\Git\git-bash.exe" as administrator and tried again and it worked. Thanks!
  • belgoros
    belgoros over 8 years
    Not for Windows: $ pacman -S mingw-w64-x86_64-ca-certificates ca-certificates bash: pacman: command not found
  • CoolOppo
    CoolOppo over 8 years
    @Javix That's why it says "If you use MSYS2". The pacman command is not available by default on Windows, but it is available if you have MSYS2 installed.
  • J4cK
    J4cK about 8 years
    As original post writing below works for me Try it out on a public repository: $ git clone github.com/schacon/grack.git For private repos, or to have push access on your repository, you can clone this way: $ git clone [email protected]/username/project.git Thanks :)
  • lucasem
    lucasem almost 8 years
    Worked for me on archlinux!
  • HappyCactus
    HappyCactus almost 7 years
    You need to use double escape chars: E:\\systools...
  • Mo Zaatar
    Mo Zaatar almost 7 years
    Make sure that you look into Program Files and Program Files (x86) ! Bloody Windows
  • Simon Tewsi
    Simon Tewsi almost 7 years
    I've just installed Git for Windows 2.13.2 and ran into this problem trying to push to the remote. I found the cert file was in a similar location: C:\Program Files\Git\mingw64\ssl\certs\ca-bundle.crt
  • C. Helling
    C. Helling over 6 years
    You might want to mention the security ramifications of this. This seems like a terrible idea, particularly globally.
  • Ben
    Ben over 6 years
    For future references the path seems to have changed for me to "C:\Program Files (x86)\Git\mingw32\ssl\certs\ca-bundle.crt"
  • Sunny Okoro Awa
    Sunny Okoro Awa over 6 years
    this worked for me, I only installed the Git using the link u shared and that solved it for me, Thanks
  • increddibelly
    increddibelly over 6 years
    BUT, be sure NOT to wrap the path in quotes. super-counter-intuitive. "C:\\folder\\file" is bad, C:\\folder\\file is good. I want my hour back.
  • prabhat mishra
    prabhat mishra over 6 years
    Not working for me ...please suggest something..Cloning the MEAN repo....... Error: Command failed: git clone --branch v0.4.2 github.com/meanjs/mean. git mean Cloning into 'mean'... fatal: unable to access 'github.com/meanjs/mean.git': error setting cer tificate verify locations: CAfile: /mingw64/ssl/certs/ca-bundle.crt CApath: none
  • Kamaraju Kusumanchi
    Kamaraju Kusumanchi about 6 years
    The path on my 64 bit machine is "C:\Program Files\Git\mingw64\ssl\certs\ca-bundle.crt"
  • Aaron C
    Aaron C about 6 years
    I just want to point out that setting http.sslverify false is not recommended and the answwer should be updated to reflect this.
  • mstrap
    mstrap about 6 years
    The answer says ".. -- not really recommended -- ..." already.
  • rkouye
    rkouye about 6 years
    On my 64 bit machine, git config --global http.sslcainfo "C:\Program Files\Git\mingw64\ssl\certs\ca-bundle.crt" worked, can't say why global while system failed.
  • Itachi
    Itachi over 5 years
    Why does curl fail?, fixed mine!
  • mmann1123
    mmann1123 over 4 years
    Worked on HPC for me
  • Xeverous
    Xeverous about 4 years
    I have added git config --system http.sslverify false and it STILL gives me the error setting certificate verify locations error. Nothing requiring internet works from git bash but Windows cmd has no problems.
  • Mital Pritmani
    Mital Pritmani over 3 years
    Thanks. I had same issue and found what you said. Setting cert with git config --global was not setting the path correctly in C:\Users\<user> so I had to update it manually and issue was fixed.

Related