Https certificate errors for GitHub using git on Windows 7
NickName:Al Lelopath Ask DateTime:2015-08-29T01:16:57

Https certificate errors for GitHub using git on Windows 7

Currently, I get this error:

$ git clone https://github.com/square/haha.git
Cloning into 'haha'...
fatal: unable to access 'https://github.com/square/haha.git/': SSL certificate problem: self signed certificate in certificate chain

I am on a Windows 7 machine. I've learned that Github's certificate is signed by DigiCert. If I look in Trusted Root Certification Authorities > Certificates, I see certificates Issued To DigiCert:

DigiCert Assured ID Root CA
DigiCert Assured ID Root G2
DigiCert Assured ID Root G3
DigiCert Global Root CA
DigiCert Global Root G2
DigiCert Global Root G3
DigiCert High Assurance EV Root CA
DigiCert Trusted Root G4

Is the GitHub certificate contained within one of these? If so, how do I use it? If not how do I get it?

Edit - more info:
I can set sslVerify to false and it works, but this is not secure of course.
I can use git:// instead of https://. This also works, but is not https.

I CANNOT USE SSH as this environment does not have proxies set up. Using ssh:

    $ git clone ssh://github.com/square/haha.git
    Cloning into 'haha'...
    D:/Program Files/Git/usr/bin/bash: -c: line 0: syntax error near unexpected token `<'
    D:/Program Files/Git/usr/bin/bash: -c: line 0: `exec corkscrew <proxyhost> <proxyport> ssh.github.com 443 ~/.ssh/proxy_auth'
    write: Broken pipe
    fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

Copyright Notice:Content Author:「Al Lelopath」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/32276466/https-certificate-errors-for-github-using-git-on-windows-7

Answers
VonC 2015-08-31T19:40:30

The idea is to download the self-signed certificate, and reference it during the clone:\n\ngit -c http.sslCAInfo=/path/to/self/signed/cert clone https://github.com/square/haha.git\n\n\nFor instance, you can use iwonbigbro/tools/bin/git-remote-install-cert.sh to:\n\n\ndownload said certificates (including the self-signed one)\n\nopenssl s_client -connect\n\nregister that certificate:\n\ngit config --global http.sslCAPath \"$HOME/.gitcerts\"\n\n\n\n(here $HOME/.gitcerts is a directory in which all certificates can be found by git)\n\nThat tool, since it is called git-remote-install-cert.sh, is executed by a git remote-install-cert (even on Windows).\n\nI would recommend though to use the latest PortableGit-2.5.1-64-bit.7z.exe, uncompressed anywhere (like in C:\\prgs\\PortableGit-2.5.1-64-bit).\nThen call C:\\prgs\\PortableGit-2.5.1-64-bit\\git-bash.exe, check $PATH and try git remote-install-cert.\n\n\n\nExample, in a simple DOS session, with a PATH including C:\\prgs\\bin:\n(it also include C:\\prgs\\PortableGit-2.5.1-64-bit\\bin, which means I am using git 2.5.0 here)\n\n\ncreate a file C:\\prgs\\bin\\git-remote-install-cert in which you copy iwonbigbro/tools/bin/git-remote-install-cert.sh (so no trailing .sh in the final local script file name)\nChange the line 111 from mkdir -m 0700 -p ${cert%/*} to mkdir -p ${cert%/*} (no need to change the line 37 though)\nGo into an existing repo.\nOr create one, and add the remote origin url:\n(Of course, adapt the path to your environment)\n\ncd C:\\Users\\vonc\\prog\ngit init b2d\ncd b2d\ngit remote add origin https://github.com/VonC/b2d\n\nFinally, call the script from that repo\n\nC:\\Users\\vonc\\prog\\b2d>git remote-install-cert\n Requesting certificate from the server...\n Certificate installed to: /c/Users/vonc/.gitcerts/github.com.crt\n\n\n\nThat will give you the certificates:\n\nC:\\Users\\vonc\\prog\\b2d>type C:\\Users\\vonc\\.gitcerts\\github.com.crt\n-----BEGIN CERTIFICATE-----\nMIIF4DCCBMigAwIBAgIQDACTENIG2+M3VTWAEY3chzANBgkqhkiG9w0BAQsFADB1\nMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3\nd3cuZGlnaWNlcnQuY29tMTQwMgYDVQQDEytEaWdpQ2VydCBTSEEyIEV4dGVuZGVk\nIFZhbGlkYXRpb24gU2VydmVyIENBMB4XDTE0MDQwODAwMDAwMFoXDTE2MDQxMjEy\nMDAwMFowgfAxHTAbBgNVBA8MFFByaXZhdGUgT3JnYW5pemF0aW9uMRMwEQYLKwYB\nBAGCNzwCAQMTAlVTMRkwFwYLKwYBBAGCNzwCAQITCERlbGF3YXJlMRAwDgYDVQQF\nEwc1MTU3NTUwMRcwFQYDVQQJEw41NDggNHRoIFN0cmVldDEOMAwGA1UEERMFOTQx\n....\n\n\nFrom there, you can, still in that repo, fetch using that certificate:\n\ncd C:\\Users\\vonc\\prog\\b2d\ngit config http.sslcapath C:\\Users\\vonc\\.gitcerts\ngit fetch\ngit checkout master\n",


More about “Https certificate errors for GitHub using git on Windows 7” related questions

Https certificate errors for GitHub using git on Windows 7

Currently, I get this error: $ git clone https://github.com/square/haha.git Cloning into 'haha'... fatal: unable to access 'https://github.com/square/haha.git/': SSL certificate problem: self signed

Show Detail

SSL certificate rejected trying to access GitHub over HTTPS behind firewall

I'm stuck behind a firewall, so I have to use HTTPS to access my GitHub repository. I'm using Cygwin 1.7.7 on Windows XP. I've tried setting the remote to https://[email protected]/username/Excel...

Show Detail

SSL certificate rejected trying to access GitHub over HTTPS behind firewall

I'm stuck behind a firewall, so I have to use HTTPS to access my GitHub repository. I'm using Cygwin 1.7.7 on Windows XP. I've tried setting the remote to https://[email protected]/username/Excel...

Show Detail

Github-Jenkins (Windows) :SSL certificate unable to get local issuer certificate

we have github installed locally and I have a jenkins build server with Github extensions. When ever I try to connect to the repository , I get a SSL certificate problem: unable to get local i...

Show Detail

Git for windows 7 failing to clone the repo from github

I have git repo https://github.com/jcubic/jquery.terminal I'm working with it using linux box (Xubuntu) it work fine but when I've try to clone it using Windows 7 git bash I got this error: jankiewj@

Show Detail

Unable to resolve "unable to get local issuer certificate" using git on Windows with self-signed certificate

I am using Git on Windows. I installed the msysGit package. My test repository has a self signed certificate at the server. I can access and use the repository using HTTP without problems. Moving to

Show Detail

How to Fix SSL certificate error when want to push to GitHub using git bash?

I am trying to push to GitHub a simple web application using git bash on Windows 8. But when i do git push origin master it says "fatal: unable to access 'https://********.com/****/******.git/': SSL

Show Detail

Github - TLS certificate verification has been disabled! on Windows

I am trying to clone a repository from Github but I couldn't clone the repo, its failed with TLS certificate verification has been disabled! error. When I run the git clone command, it redirects to

Show Detail

Github - TLS certificate verification has been disabled! on Windows

I am trying to clone a repository from Github but I couldn't clone the repo, its failed with TLS certificate verification has been disabled! error. When I run the git clone command, it redirects to

Show Detail

Self Signed SSL Certificate Use With Windows Server 2012, Bonobo Git Server

I'm attempting to communicate with my Bonobo Git repo hosted on a Windows 2012 server using Aptana Studio 3 on my Workstation. I have followed countless guides on creating self signed SSL certifica...

Show Detail