18

I've got the latest version of curl and still not seeing http2 show up as a feature. I've followed steps around related questions, but still out of luck.

$ /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

any ideas?

Simone Carletti
  • 173,507
  • 49
  • 363
  • 364
Mark Fine
  • 211
  • 2
  • 5

3 Answers3

30

brew info curl lists the required flags to enable that feature.

brew reinstall curl --with-openssl --with-nghttp2 will update your installation.

Jeremiah Winsley
  • 2,537
  • 18
  • 30
26

The Homebrew team recently removed all options for the curl formula, but the curl-openssl formula has HTTP/2 enabled.

brew install curl-openssl
Jeff Hardy
  • 7,632
  • 24
  • 24
10

By default, curl is not compiled with nghttp2. As explained in this article, you need to recompile it passing the --with-nghttp2 flag and link it (to replace the original curl shipped with Mac OS X.

# 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
Simone Carletti
  • 173,507
  • 49
  • 363
  • 364