小编Cur*_*oso的帖子

带有CURL的HTTP2给出"不支持的协议"

已经按照这里的步骤,我仍然Unsupported Protocol使用curl --http2选项.类似地,设置CURLOPT_HTTP_VERSIONCURL_HTTP_VERSION_2_0使用HTTP/1.1进行通信的结果在节目中,未HTTP/2.

平台:VMware Player 7上的Ubuntu 15.04.

我已经安装了nghttp2-1.0.4 --prefix=/usr/local,因此libnghttp2.*位于/usr/local/lib.

这是配置curl-7.43.0的代码:

./configure --with-nghttp2=/usr/local
Run Code Online (Sandbox Code Playgroud)

结果显示HTTP2已启用:

    HTTP2 support:    enabled (nghttp2)
Run Code Online (Sandbox Code Playgroud)

makesudo make install,以下回报Unsupported Protocol:

curl --http2 https://http2.akamai.com
Run Code Online (Sandbox Code Playgroud)

curl版本不支持nghttp2:

curl 7.43.0 (i686-pc-linux-gnu) libcurl/7.38.0 OpenSSL/1.0.1f zlib/1.2.8 libidn/1.28 librtmp/2.3
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp smtp smtps telnet tftp 
Features: AsynchDNS IDN IPv6 Largefile GSS-API SPNEGO NTLM NTLM_WB …
Run Code Online (Sandbox Code Playgroud)

curl http2

16
推荐指数
1
解决办法
1万
查看次数

标签 统计

curl ×1

http2 ×1