如何在libcurl中启用https支持?

Ben*_*old 18 git homebrew libcurl

当我试图$ brew update收到错误时:

error: Protocol https not supported or disabled in libcurl while accessing https://github.com/mxcl/homebrew/info/refs?service=git-upload-pack
Run Code Online (Sandbox Code Playgroud)

但是,当我$ curl --version,我看到:

curl 7.21.4 (x86_64-apple-darwin12.2.0) libcurl/7.21.4 OpenSSL/0.9.8y zlib/1.2.5 libidn/1.20
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp smtp smtps telnet tftp 
Features: IDN IPv6 Largefile NTLM SSL libz 
Run Code Online (Sandbox Code Playgroud)

除非我遗漏了什么,否则这对我来说很好.请注意https协议列表中列出的内容.

$ which curl 产生可疑的回应:

/usr/local/php5/bin/curl
Run Code Online (Sandbox Code Playgroud)

嗯...也许brew是在使用不同的curl(就像那个/usr/bin/curl).让我们来看看:

$ /usr/bin/curl --version

curl 7.24.0 (x86_64-apple-darwin12.0) libcurl/7.24.0 OpenSSL/0.9.8y zlib/1.2.5
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp smtp smtps telnet tftp 
Features: AsynchDNS GSS-Negotiate IPv6 Largefile NTLM NTLM_WB SSL libz 
Run Code Online (Sandbox Code Playgroud)

好吧,它显然是一个不同的安装curl,但它也列https在协议列表中,并在那里也有OpenSSL信息.

顺便说一句:如果我尝试在我的机器上https使用任何gitrepo 的URL,我会得到同样的错误.

问题:

  1. 我怎么能确定的路径,curlbrew使用?
  2. 如何启用支持httpslibcurl

更新:通过下面的deltheil方法libcurl.4.dylib,我能够确定git(和brew)正在使用的路径.路径是:

/usr/lib/libcurl.4.dylib (compatibility version 6.0.0, current version 6.1.0)
Run Code Online (Sandbox Code Playgroud)

所以我尝试了这个:

$ brew install curl --with-libssh2
Run Code Online (Sandbox Code Playgroud)

幸运的是,卷曲是在非SSL URI上提供的,所以它实际上是insstall.它没有符号链接/usr/local,但这对我很好(我认为).所以我这样做了:

$ cd /usr/lib
$ mv libcurl.4.dylib libcurl.4.dylib.bk
$ ln -s /usr/local/Cellar/curl/7.30.0/lib/libcurl.4.dylib libcurl.4.dylib
$ brew update
Run Code Online (Sandbox Code Playgroud)

但它仍然给我这个错误:

error: Protocol https not supported or disabled in libcurl while accessing https://github.com/mxcl/homebrew/info/refs?service=git-upload-pack
Run Code Online (Sandbox Code Playgroud)

所以,现在的问题变成独家:如何启用支持httpslibcurl

del*_*eil 6

如何确定brew使用的卷曲路径?

自制的用途/usr/bin/curl,即版本附带的Mac OS X,你可以看到在这里.

话虽如此,并且正如您所说,您的问题可能与链接git和用于http://和的libcurl版本有关https://.

执行a which git以确定您正在使用的版本(我的安装版本/usr/local).

然后扫描使用的共享库如下:

$ otool -L /usr/local/git/libexec/git-core/git-http-push | grep curl
/usr/lib/libcurl.4.dylib
Run Code Online (Sandbox Code Playgroud)

替换为/usr/local/与您的对应的安装目录git.

由于你的gitexec 使用的libcurl版本缺乏HTTPS支持,这将告诉你这个版本是什么以及它的安装位置.