【发布时间】:2013-10-01 15:45:46
【问题描述】:
当我尝试$ brew update 时出现错误:
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
嗯嗯...也许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 信息。
顺便说一句:如果我尝试在我的机器上使用带有任何 git 存储库的 https URL,我会遇到同样的错误。
问题:
如何确定brew正在使用的curl的路径?- 如何在
libcurl中启用对https的支持?
更新:我能够通过以下 deltheil 的方法确定git(和brew)正在使用的libcurl.4.dylib 的路径。路径是:
/usr/lib/libcurl.4.dylib (compatibility version 6.0.0, current version 6.1.0)
所以我尝试了这个:
$ brew install curl --with-libssh2
幸运的是 curl 在非 SSL URI 上可用,所以它确实安装了。它没有符号链接到/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
所以现在问题完全变成了:如何在libcurl 中启用对https 的支持?
【问题讨论】: