2013-09-25 119 views
12

当我尝试$ brew update,我发现了错误:如何在libcurl中启用https支持?

error: Protocol https not supported or disabled in libcurl while accessing https://github.com/mxcl/homebrew/info/refs?service=git-upload-pack 

然而,当我$ 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 

除非我失去了一些东西,这对我来说很好。请注意,协议列表中列出了https

$ which curl产生一个可疑响应:

/usr/local/php5/bin/curl 

Hmmmmm ...也许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 

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

顺便说一句:如果我尝试在我的机器上使用https URL与任何git回购,我会得到相同的错误。

问题:

  1. 如何确定的路径curlbrew使用?
  2. 如何在libcurl中启用对https的支持?

UPDATE:我能够确定libcurl.4.dylib的路径git(和brew)由以下以下deltheil的方法,使用。路径是:

/usr/lib/libcurl.4.dylib (compatibility version 6.0.0, current version 6.1.0) 

所以,我想这一点:

$ brew install curl --with-libssh2 

幸运的是卷曲可在非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 

但它仍然抛出我这个错误:

error: Protocol https not supported or disabled in libcurl while accessing https://github.com/mxcl/homebrew/info/refs?service=git-upload-pack 

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

回答

4

How can I determine the path to the curl that brew is using?

家酿使用/usr/bin/curl,即附带的Mac OS X,你可以看到here版本。

这就是说,而且正如你所说的,你的问题可能与与git连接并用于http://https://的libcurl的版本有关。

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

然后扫描作为后续共享库:

$ otool -L /usr/local/git/libexec/git-core/git-http-push | grep curl 
/usr/lib/libcurl.4.dylib 

替换/usr/local/与对应于你git安装目录。

由于您的git exec使用的libcurl版本缺少HTTPS支持,因此它会告诉您此版本及其安装位置。

+0

感谢@deltheil,你有我一半。我已经用当前的进度更新了这个问题。 –

+0

因为'git'正确链接到系统libcurl,它支持https,所以肯定有什么问题。这就是说,你应该永远**,永远**修改你的系统文件在'/ usr/bin'下,'/ usr/lib'等等。我建议你运行一个'brew doctor'并检查这个[Github HTTPS克隆错误](https://help.github.com/articles/https-cloning-errors)页面。 – deltheil

+0

或者你可能想通过Homebrew通过'with-brewed-curl'选项来正确安装'git',这样'git'就可以使用brew中的'curl',这取决于'darwinssl'的SSL支持。 – deltheil

0

我在OSX上遇到了这个问题。这个问题是在usr/local/bin中重复curl和curl.config文件,它们与usr/bin中的相同两个文件发生冲突。我删除了本地/ bin中的第一个集合,然后终端工作。

1

这为我工作:当你运行命令“卷曲--version”你会

$ ./configure --with-darwinssl  
$ make  
$ make test  
$ sudo make install 

重新安装卷曲并使用以下命令安装它(开封后)请注意,https协议现在位于“协议”下。

有用的网站是指当你进入卷曲问题:https://curl.haxx.se/docs/install.html