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?
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?
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 :)
On Linux, I had this error and fixed it by running sudo update-ca-certificates
.
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.
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
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.
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\.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.
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).
Just install the certificate packages with the following commands:
pacman -S mingw-w64-i686-ca-certificates ca-certificates
pacman -S mingw-w64-x86_64-ca-certificates ca-certificates
I was able to solve this issue with the following command.
git config --system http.sslverify false
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
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 !
I received this error after moving git across hard drives. Deleting and reinstalling in the new location fixed things
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.
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(-)
git config --global http.sslverify "false"
Will solve the problem. After that a Pop-up window appears to enter your username and password
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!
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.
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:
curl-**.**.*/lib
in the command line./mk-ca-bundle.prl
ca-bundle.crt
to your git path and update the config as listed in other answersShout out to this gist for helping me get the installation done.
In my win10 case I have two versions of .gitconfig
C:\Program Files\Git\etc
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.
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 [email protected]:account/someproject.git
git config --system http.sslcainfo /bin/curl-ca-bundle.crt
This works. You don't have to give full path.
The solution that work for me in windows 64bits is the following
git config --system http.sslverify false
Source: Stackoverflow.com