Curl支持HTTP2
一般情况下,都是利用系统的apt-get、yum来进行CURL库的安装。但是,在安装过程中,并支持http2协议。所以,有时候需要重新进行自编译。
curl各个版本的下载地址
https://curl.se/download/
重新自编译安装curl库
apt-get remove curl
apt-get install -y nghttp2
apt-get install -y libnghttp2-dev
apt-get install -y libssl-dev
./configure --with-nghttp2 --prefix=/usr/local --with-ssl --enable-versioned-symbols
make && make install
echo ‘/usr/local/lib’ >> /etc/ld.so.conf.d/local.conf
ldconfig
在执行完 ./configure 后,注意最后的输出文档
PSL: no (libpsl not found)
Alt-svc: no (–enable-alt-svc)
HTTP2: enabled (nghttp2)
HTTP3: disabled (–with-ngtcp2, --with-quiche)
ESNI: no (–enable-esni)
Protocols: DICT FILE FTP FTPS GOPHER HTTP HTTPS IMAP IMAPS POP3 POP3S RTSP SMB SMBS SMTP SMTPS TELNET TFTP
Fe