cURL is not working with nghttp2 cURL is not working with nghttp2 curl curl

cURL is not working with nghttp2


You're probably not running the newly built curl, or your new curl build is using the previous libcurl install. Invoke 'curl --version' and make sure it lists "HTTP2" as supported (included in Features).

You also need to make sure you build curl with an TLS library version that has support for ALPN (for HTTP/2 over TLS). If you build with openssl, you need version 1.0.2 (or later).

I just tried now on https://http2.akamai.com/ and it says "You are using HTTP/2 right now!" just fine when I try my curl build on it like this:

$ curl --http2 -kv https://http2.akamai.com/ 

You can view the verbose output and you should see the ALPN offer and what protocol curl and the server agree on using.


The page is probably whitelisted for particular browsers that are HTTP/2 enabled, so it's returning a static content because it doesn't recognize the cURL one. You can set your user agent to pretend that you're Chrome, e.g.

curl -A "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/41.0.742.112 Safari/534.30" --http2 https://http2.akamai.com/