curlhttp2nghttp2

cURL is not working with nghttp2


I want to use http/2 with cURL. First I got an error when I tried this curl --http2 https://http2.akamai.com/ - "Protocol not supported". I installed nghttp2 and reinstalled cURL like it is described here. The error is gone and I can get data with the curl --http2 now. But the page https://http2.akamai.com/ tells me "This browser is not HTTP/2 enabled", while in chrome or directly via nghttp2 it says "You are using HTTP/2 right now!".

I'm using mac os x and installed all dependencies in the latest versions via homebrew. The curl sources (7.41) I downloaded here.


Solution

  • 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.