using --http2.0 option with curl 7.33.0 gives unsupported protocol
Asked Answered
C

1

7

I am using centos 6.2, i needed to use curl --http2.0 in one of the server request, but i was having 7.19.6, after looking at http://curl.haxx.se/docs/manpage.html gives me that --http2.0 option is only supported with curl 7.33.0, so to overcome that problem, i have installed curl 7.33.0 by following the steps from http://www.linuxfromscratch.org/blfs/view/svn/basicnet/curl.html after installing curl, i have tried to use that, but it is still giving me the error as curl(1):unsupported protocol, i have checked my curl version by using: curl --version this is giving me :

curl 7.33.0 (x86_64-unknown-linux-gnu) libcurl/7.33.0 OpenSSL/1.0.0 zlib/1.2.3
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp smtp smtps telnet tftp 
Features: AsynchDNS IPv6 Largefile NTLM NTLM_WB SSL libz 

I needed to use this --http2.0 but not getting anything that how i could do that? As curl 7.19 was installed and and i reinstalled curl with higher version, does this is making any problem?

Cookshop answered 21/11, 2013 at 9:25 Comment(0)
S
6

As explained by Daniel on the mailing list:

My plan is to base the http2 work on the nghttp2 library (https://github.com/tatsuhiro-t/nghttp2) [...] HTTP2 will start as a "feature" in libcurl terms and not specifically as a separate protocol.

So first of all you need to install nghttp2 manually[1].

Then you need to explicitly enable HTTP2 support at configure-time with --with-nghttp2:

./configure --with-nghttp2=/path/to/nghttp2/install/dir [...]

[1]: at the time of writing the README states that it is not packaged in Ubuntu, so you need to build it yourself.

EDIT

Please find below basic instructions to build the library only (not the command line tool) with default options.

To build nghttp2 you first need to install its requirements (as detailed on nghttp2 documentation page):

# To clone the nghttp2 Github repo
yum install git

# Build essentials
yum install gcc
yum install make
yum install automake
yum install libtool

# Required to build the library
yum install pkgconfig
yum install zlib-devel

Once done clone the repo:

git clone https://github.com/tatsuhiro-t/nghttp2.git
cd nghttp2

Build the library as explained here:

autoreconf -i
automake
autoconf
# Note: I assume you want to deploy it under /usr/local
# Feel free to adapt to your needs!
./configure --prefix=/usr/local
make

Then deploy it:

make install

If everything is OK you then need to build libcurl 7.33.0 by taking care to enable nghttp2 with ./configure --with-nghttp2=/usr/local [...].

Extras

If you want to build the application programs in addition (nghttp, ...) you would have to install additional packages before building nghttp2:

yum install openssl-devel
yum install libevent-devel
yum install libxml2-devel
yum install jansson-devel
Sanfo answered 23/11, 2013 at 20:56 Comment(6)
i m not able to install it, can you give me step wise step all instructions to install it, as i m novice user to linux... thanks for supportCookshop
if possible, give the instructions for other required software to support itCookshop
I've edited my question with nghttp2 library build instructions.Sanfo
autoreconf -i is giving me error as:perl: warning: Setting locale failed. perl: warning: Please check that your locale settings: LANGUAGE = (unset), LC_ALL = (unset), LC_CTYPE = "UTF-8", LANG = "en_US.UTF-8" are supported and installed on your system. perl: warning: Falling back to the standard locale ("C"). <br/> configure.ac:205: warning: macro `AM_PATH_XML2' not found in library autoreconf: /usr/bin/autoconf failed with exit status: 1Cookshop
Great! I've edited my answser once again with extra packages that may be needed (especially libxml2-devel that I assume you've installed to fix your configure error).Sanfo
ya i have preinstalled that oneCookshop

© 2022 - 2024 — McMap. All rights reserved.