curl不支持mac上的http2

时间:2015-07-29 18:38:28

标签: curl homebrew http2

我已经获得了curl的最新版本,仍然没有看到http2显示为一项功能。我已经按照相关问题的步骤,但仍然没有运气。

$ /usr/local/Cellar/curl/7.43.0/bin/curl -V
curl 7.43.0 (x86_64-apple-darwin14.3.0) libcurl/7.43.0 SecureTransport zlib/1.2.5
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp 
Features: IPv6 Largefile NTLM NTLM_WB SSL libz UnixSockets

任何想法?

3 个答案:

答案 0 :(得分:28)

brew info curl列出了启用该功能所需的标志。

brew reinstall curl --with-openssl --with-nghttp2将更新您的安装。

答案 1 :(得分:10)

默认情况下,curl未使用nghttp2进行编译。作为explained in this article,您需要重新编译它,并传递--with-nghttp2标记并将其链接(以替换Mac OS X附带的原始curl

# install cURL with nghttp2 support
$  brew install curl --with-nghttp2

# link the formula to replace the system cURL
$  brew link curl --force

# now reload the shell

答案 2 :(得分:9)

Homebrew小组最近removed all options for the curl formula,但是curl-openssl公式已启用HTTP / 2。

brew install curl-openssl