24

I just installed git for windows and tried to clone glew's repo like this

$ git clone https://github.com/nigels-com/glew.git 

But I got the following error

Cloning into 'glew'... fatal: unable to access 'https://github.com/nigels-com/glew.git/': SSL certificate problem: self signed certificate 

I've seen people running into this problem and some possible workarounds.

First try

$ git -c http.sslVerify=false clone https://github.com/nigels-com/glew.git Cloning into 'glew'... fatal: unable to access 'https://github.com/nigels-com/glew.git/': Empty reply from server 

Second try

$ git config --global http.sslVerify false $ git clone https://github.com/nigels-com/glew.git Cloning into 'glew'... fatal: unable to access 'https://github.com/nigels-com/glew.git/': Empty reply from server 

Then I checked for http.sslcainfo entry in the config files

$ git config --system --list credential.helper=manager $ git config --global --list https.proxy=<proxy-address> http.sslverify=false 

System and global config files does not have that entry. So I tried the following which I don't know what file is reading and try to unset it.

$ git config --list core.symlinks=false core.autocrlf=true core.fscache=true color.diff=auto color.status=auto color.branch=auto color.interactive=true help.format=html http.sslcainfo=C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt diff.astextplain.textconv=astextplain rebase.autosquash=true credential.helper=manager http.sslverify=false $ git config --unset http.sslcainfo fatal: not in a git directory 

Tried with global and system

$ git config --global --unset http.sslcainfo $ git clone https://github.com/nigels-com/glew.git Cloning into 'glew'... fatal: unable to access 'https://github.com/nigels-com/glew.git/': SSL certificate problem: self signed certificate $ git config --system --unset http.sslcainfo error: could not lock config file C:\Program Files\Git\mingw64/etc/gitconfig: Permission denied error: could not lock config file C:\Program Files\Git\mingw64/etc/gitconfig: Invalid argument 

I still cannot clone that github repo. Any other idea I can try to fix this problem? What am I missing?

5
  • 1
    Looks like a proxy issue. Commented Aug 17, 2016 at 21:44
  • Already put proxy into git, but still not able to clone from git. Any other idea? Commented Aug 26, 2016 at 14:23
  • 1
    Your first attempt worked for me. Thanks! Commented Oct 18, 2016 at 8:08
  • 1
    Related: How can I make git accept a self signed certificate?. (Not necessarily a duplicate. Accepted answer only works after a repository has been cloned) Commented Sep 27, 2017 at 16:07
  • your "first try" just worked for me...thanks! Commented Feb 16, 2022 at 15:01

5 Answers 5

12

You can disable SSL verification using the below command

git config --global http.sslVerify false 
Sign up to request clarification or add additional context in comments.

1 Comment

While this may fix the issue for others the question lists this exact command as something that was tried and did not work, I don't understand why this is upvoted
4

I know this is old, but I thought I would post the solution anyway. Per this Answer to a similar question

you can run:

git config --global http.sslBackend schannel 

this will configure git to use the local windows certificate store for SSL verification.

Comments

1

You can also use the below command in the Visual Studio command prompt and then try to clone the code from repository.

C:\Program Files\Microsoft Visual Studio\2022\Enterprise>git config --global http.sslBackend schannel 

1 Comment

Perfect, I just typed this command into regular command prompt and it solved my issue. Thanks !
0

Only this two config should work properly..

git config --global --unset http.proxy

git config --global http.sslVerify false

Comments

-12

You're overthinking this. Git requires the SSH key to do the transfer. In order for this to work, you need an account on GitHub. If you have already generated an SSH key pair for other sites, you can reuse that one. All you need to do is log into GitHub.com and copy it there in your settings panel.

If you don't have an account, make one. If you haven't generated a key pair, that's simple:

ssh-keygen -t rsa -C "[email protected]" 

Then copy the key to your settings in GitHub.com

There are instructions all over the place on how to do this in various ways. I have a self-signed cert and I was able to clone the repo you listed.

4 Comments

A couple of weeks ago I remember being able to clone repos without that. Would that mean if I want to clone repos from GitLab or BitBucket I must create an account and copy my ssh key to each account? Something's missing here ...
Wrong, SSL has nothing to do with SSH.
yea, this is wrong. This does not solve the problem but, rather uses a different technology to get the repo.
wrong answer, its a shame that this answer is accepted here.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.