Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

curl does not support http2 on mac

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?

like image 848
Mark Fine Avatar asked Jul 29 '15 18:07

Mark Fine


People also ask

How do I enable http2 on curl?

To tell curl to use http2, either plain text or over TLS, you use the --http2 option (that is “dash dash http2”). curl defaults to HTTP/1.1 for HTTP: URLs so the extra option is necessary when you want http2 for that. For HTTPS URLs, curl will attempt to use http2.

How do I know if my curl supports http2?

Running curl -V will show if your version of curl supports it. If you by some chance already know that your server speaks HTTP/2 (for example, within your own controlled environment where you know exactly what runs in your machines) you can shortcut the HTTP/2 "negotiation" with --http2-prior-knowledge .

Does macOS have curl?

Install curl on Mac If you have a Mac, by default, curl is probably already installed. To check: Open Terminal (press Cmd + spacebar to open Stoplight, and then type “Terminal”).


1 Answers

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

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

like image 176
Jeremiah Winsley Avatar answered Oct 28 '22 05:10

Jeremiah Winsley