Github: error cloning my private repository
GitGithubGit Problem Overview
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?
Git Solutions
Solution 1 - Git
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 - Git
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 - Git
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 - Git
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?][1] [1]:https://serverfault.com/a/126157
Solution 5 - Git
git config --global http.sslverify "false"
Will solve the problem. After that a Pop-up window appears to enter your username and password
Solution 6 - Git
SOLVED: I got this error when I installed an update to the Git windows installer. What happened is that I did not install it with administrator rights, so Git was installed in "C:\Users\my_name\AppData\Local\Programs" instead of "C:\program Files". re-installing Git as administrator allowed to put it in C:\program Files and everything went fine again !
Solution 7 - Git
This worked for me (I'm using Manjaro linux). I run the cmd to view ca-certificates:
$ curl-config --ca
**/etc/ssl/certs/ca-certificates.crt**
But actually i found the certificates at the path:
**/etc/ca-certificates/extracted/ca-bundle.trust.crt**
Then add the config into ~/.gitconfig (if not existing, create it):
**vim ~/.gitconfig**
[http]
sslVerify = true
sslCAinfo = /etc/ca-certificates/extracted/ca-bundle.trust.crt
[user]
email = <email of github account>
name = <username of github account>
It works!
.rbenv]$ git pull
remote: Counting objects: 70, done.
remote: Compressing objects: 100% (47/47), done.
remote: Total 70 (delta 39), reused 12 (delta 12), pack-reused 6
Unpacking objects: 100% (70/70), done.
From https://github.com/sstephenson/rbenv
c43928a..efb187f master -> origin/master
+ 37ec781...7e57b52 user-gems -> origin/user-gems (forced update)
Updating c43928a..efb187f
Fast-forward
libexec/rbenv-init | 4 ++--
libexec/rbenv-version-file | 1 +
test/init.bats | 2 +-
test/test_helper.bash | 25 +++++++++++++++----------
4 files changed, 19 insertions(+), 13 deletions(-)
Solution 8 - Git
git config --system http.sslcainfo /bin/curl-ca-bundle.crt
This works. You don't have to give full path.
Solution 9 - Git
I faced this while git pull. For mine edited the global git config file that fixed problem.
Goto your home folder and open .gitconfig file. Usually C:\Users<YOUR_NAME>.gitconfig
If the file is not there create it
> [http]
sslcainfo = E:\systools\git-1.8.5.2\bin\curl-ca-bundle.crt
There you have to given your own git installation path. I have used portable version of git here.
Then git clone / pull it will work.
Solution 10 - Git
If you are using the Git command shell that installs with the GitHub for Windows app then this and various other problems can show after an update. Just start the Git Hub windows app and shut it down again. The shell will then work OK again. The problem is that the update does not complete until the windows application is run. Just using the shell on its does not trigger the update to complete.
Solution 11 - Git
I've seen this on my Github for Windows.
I recommend uninstalling Github for Windows and installing it again.
Before this, I tried several ways with no success, but this solution worked for me!
Solution 12 - Git
In my win10 case I have two versions of .gitconfig
- the first one is in
C:\Program Files\Git\etc
- the second is in
C:\Users\<user>
The command
git config --system http.sslcainfo "C:\Program Files\Git\mingw64\ssl\certs\ca-bundle.crt"
indeed makes changes to C:\Program Files\Git\etc
, but git somehow uses config in C:\Users\<user>
So with notepad I changed the second one .gitconfig
and git finally took right configuration and got working.
Solution 13 - Git
On Windows using msysgit I had this error and the cause was my additions of our corporate proxy certificates.
If you edit your curl-ca-bundle.crt you have to get sure about your lineendings. In case of the curl-ca-bundle you have to use Linux-Style lineendings.
> git ls-remote --tags --heads https://github.com/oblador/angular-scroll.git
fatal: unable to access 'https://github.com/oblador/angular-scroll.git/': error setting certificate verify locations:
CAfile: C:\Program Files (x86)\Git\bin\curl-ca-bundle.crt
CApath: none
You can use notepad++ to convert the lineendings to Linux (linefeed).
Solution 14 - Git
On a side note, this issue can happen in Windows if the user who is trying to use git is different than the user who installed it. The error may indicate that git cannot access the certificate files. Installing git as the administrator and using @rogertoday's answer resolved my issue.
Solution 15 - Git
I found a good solution for adding/updating the CA certificates on RHEL/CentOS 6 which is the root cause reported issue.
Since they become outdated distros, the cacert authorities in that system has not been updated until executing the command sudo yum update
.
Didn't realize the issue until the GIT_CURL_VERBOSE mode shows the cacert path issue.
Solution 16 - Git
I encountered this error after updating to Visual Studio 2019 16.10.2 (from 16.10.0), whereas previously Git was working correctly.
I do not have Git installed separately. (Or, put another way, I only use Git as part of Visual Studio.)
I solved this problem by locating the file "ca-bundle.crt"
at "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git\mingw32\ssl\certs\ca-bundle.crt"
, and then copying it to the folder it was indicating it couldn't be found at, "C:\Program Files\Git\mingw64\ssl\certs\ca-bundle.crt"
.
Do note that I had to create the "\mingw64\ssl\certs" directories, as they did not previously exist.
After copying the file there, Git was able to sync once again immediately without restarting Visual Studio.
Solution 17 - Git
On Linux, I had this error and fixed it by running sudo update-ca-certificates
.
Solution 18 - Git
If anybody else is facing this issue in Git for Windows and do not have curl-ca-bundle.crt
anywhere on your system even after reinstalling, this is the process I followed:
- Download the latest version of curl here: curl download mirror
- Extract and navigate to
curl-**.**.*/lib
in the command line - Run
./mk-ca-bundle.prl
- Copy
ca-bundle.crt
to your git path and update the config as listed in other answers
Shout out to this gist for helping me get the installation done.
Solution 19 - Git
I've solved this problem on a Windows Server 2016 by reinstalling it and by choosing "native Windows Secure Channel library" on the "Choosing HTTPS transport backend" install step.
Solution 20 - Git
For MinGit users on Windows 10:
You'll have to make slight adjustments to @mstrap's answer.
git config --system http.sslcainfo "<PATH-TO-MINGIT>\mingw64\ssl\certs\ca-bundle.crt"
Solution 21 - Git
For me what solved the problem was when on my windows 10 box, I tried uninstalling git and resintalling, using Windows Cmd as default not Git Bash
Open CMD and run the following
//Once installed try to resintall the bin folder
git config --system http.sslcainfo \bin/curl-ca-bundle.crt
//disable ssl verification
git config --global http.sslverify "false"
//Then try to clone repo again
git clone git@github.com:account/someproject.git
Solution 22 - Git
I received this error after moving git across hard drives. Deleting and reinstalling in the new location fixed things
Solution 23 - Git
On git for Windows you can also reinstall and select the Windows native certificate validation method (OpenSSL is default). This will skip the OpenSSL verification and instead use the Windows native one, which doesn't require maintaining a separate tool (OpenSSL) and certificates.
Worked perfectly for me :)
Solution 24 - Git
The solution that work for me in windows 64bits is the following
> git config --system http.sslverify false
Solution 25 - Git
The following command
git clone git://github.com/username/projectname.git
worked for my needs, but I assume you want more than read-only access, right?
Solution 26 - Git
I was able to solve this issue with the following command.
git config --system http.sslverify false