It seems like curl packed with ubuntu 16.04 does not have http2 support. How do I enable http2 in curl
1 Answer
As of now (Jan 2018). You will have to install curl from source to get http2 support. You can do that using the following commands
sudo apt-get -y install build-essential nghttp2 libnghttp2-dev libssl-dev
wget https://curl.haxx.se/download/curl-7.63.0.tar.gz
tar xzf curl-7.63.0.tar.gz
cd curl-7.63.0
./configure --with-nghttp2 --prefix=/usr/local --with-ssl
make && sudo make install
sudo ldconfig
-
-
2@user535733 . Thanks, this will install curl inside /usr/local So it won't collide with the default installation. You can even use them side by side.– TachyonsFeb 20, 2017 at 16:01
-
2If it's still not working, then you may need to restart shell or clear your hash if you've used
/usr/bin/curl
lately. askubuntu.com/q/923527/453746 Jun 8, 2017 at 22:05 -
3Most likely you'll want to compile with ssl support as well. Then install
sudo apt-get install libssl-dev
first and add run configure command this way:./configure --with-nghttp2 --prefix=/usr/local --with-ssl=/usr/local/ssl
– StalinkoAug 28, 2017 at 9:19 -
2@Tachyons in my case it wasn't. I think it depends on env settings. When you don't pass this parameter deliberately then
configure
reads it from env variablesOPENSSL_CFLAGS
andOPENSSL_LIBS
– StalinkoAug 28, 2017 at 17:22