centos7 yum升级curl支持http2
默认的curl命令是不支持http2协议,所以下面的操作来让其支持http2.
系统:centos7.x(64位)
1.安装yum源
cat > /etc/yum.repos.d/city-fan.repo << EOF [cityfan] name=cityfan baseurl=http://www.city-fan.org/ftp/contrib/yum-repo/rhel7/x86_64/ enabled=1 gpgcheck=0 EOF
2.更新curl
yum update curl -y
3.进行验证
curl --version
curl --http2 -I https://nghttp2.org
HTTP/2 200
date: Sun, 04 Sep 2022 05:16:03 GMT
content-type: text/html
last-modified: Mon, 22 Aug 2022 12:34:53 GMT
etag: "630377ed-18b4"
accept-ranges: bytes
content-length: 6324
x-backend-header-rtt: 0.001217
strict-transport-security: max-age=31536000
server: nghttpx
alt-svc: h3=":443"; ma=3600, h3-29=":443"; ma=3600
via: 2 nghttpx
x-frame-options: SAMEORIGIN
x-xss-protection: 1; mode=block
x-content-type-options: nosniff
或者
curl --http2 -I https://blog.slogra.com
HTTP/2 200
server: nginx
date: Sun, 04 Sep 2022 05:18:27 GMT
content-type: text/html; charset=UTF-8
vary: Accept-Encoding
vary: Accept-Encoding
strict-transport-security: max-age=63072000
x-frame-options: DENY
x-content-type-options: nosniff
x-xss-protection: 1
可以看到curl已经支持http2了.
评论: