Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cygwin git "Protocol "https" not supported or disabled in libcurl"

Tags:

git

github

I'm using cygwin under Windows 7. Everything was fine until one day I found that I cann't use git to clone github repos and it says "Protocol "https" not supported or disabled in libcurl". But when I type "curl --version" it says

curl 7.39.0 (x86_64-unknown-cygwin) libcurl/7.39.0 OpenSSL/1.0.1k zlib/1.2.8 libidn/1.29 libssh2/1.4.2 Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp scp sftp smtp smtps telnet tftp Features: Debug IDN IPv6 Largefile GSS-API SPNEGO NTLM NTLM_WB SSL libz TLS-SRP Metalink

I think this means https is supported by curl. Can anyone help me? Thanks in advance.

like image 745
Liu Renjie Avatar asked Jan 18 '15 12:01

Liu Renjie


2 Answers

As a workaround to using HTTPS, you can switch to using SSH as your protocol for git. When I clone repositories, I usually use SSH, since it's a little more flexible and I have to deal with proxies sometimes. Changing your protocol can be accomplished by switching the URLs of your GitHub remote. If you list the remotes you currently have, you'll see something like (assuming you're in your project directory):

origin  https://github.com:someuser/project.git (fetch)
origin  https://github.com:someuser/project.git (push)

You can switch https:// to git@git://, and add SSH keys to git for the computer you're working on. Then you'll be able to connect to GitHub via SSH, and checkout git repositories over SSH protocol, avoiding HTTPS. Once you set up your public key on GitHub, you'll be able to do passwordless SSH into GitHub.com, and access GitHub repos.

You can switch from HTTPS to SSH protocol with the git remote set-url command, as documented here. You'll pass it the remote name, which'll be origin by default:

git remote set-url origin [email protected]:someuser/project.git

and you should be good to go.

like image 196
charlesreid1 Avatar answered Oct 14 '22 11:10

charlesreid1


I think this means https is supported by curl.

More precisely, GitHub doesn't allow that particular version of curl anymore (at the time of the question, January 2015): see bagder/curl/issues/267.

That issue refers to the new GitHub SSL report, and its corresponding announcement:

To keep GitHub as secure as possible for every user, we will remove RC4 support in our SSL configuration on github.com and in the GitHub API on January 5th 2015.

Try and upgrade curl: the current package (July 2015) is curl-7.43.0-1.


Note: instead of Cygwin, you can use the latest Git for Windows: simply uncompress PortableGit-2.4.5.1-4th-release-candidate-64-bit.7z.exe anywhere you want and launch a bash session (like a lightweight cygwin, with 200+ Linux commands).

C:\path\to\PortableGit-2.4.5.1-4th-release-candidate-64-bit\git-bash.exe

That includes a curl compatible with GitHub:

$ curl --version
curl 7.43.0 (x86_64-w64-mingw32) libcurl/7.43.0 OpenSSL/1.0.2c zlib/1.2.8 libidn/1.30 libssh2/1.6.0 librtmp/2.3
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp scp sftp smtp smtps telnet tftp
Features: IDN Largefile SSPI Kerberos SPNEGO NTLM SSL libz TLS-SRP
like image 24
VonC Avatar answered Oct 14 '22 10:10

VonC