惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V2EX - 技术
V2EX - 技术
P
Privacy International News Feed
Security Latest
Security Latest
H
Hacker News: Front Page
T
Tenable Blog
The Hacker News
The Hacker News
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
S
Security @ Cisco Blogs
Project Zero
Project Zero
O
OpenAI News
AI
AI
Spread Privacy
Spread Privacy
C
CERT Recently Published Vulnerability Notes
The Last Watchdog
The Last Watchdog
G
GRAHAM CLULEY
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Scott Helme
Scott Helme
Application and Cybersecurity Blog
Application and Cybersecurity Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
C
CXSECURITY Database RSS Feed - CXSecurity.com
NISL@THU
NISL@THU
A
Arctic Wolf
T
Threat Research - Cisco Blogs
PCI Perspectives
PCI Perspectives
N
News and Events Feed by Topic
C
Cyber Attacks, Cyber Crime and Cyber Security
C
Cybersecurity and Infrastructure Security Agency CISA
Simon Willison's Weblog
Simon Willison's Weblog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Know Your Adversary
Know Your Adversary
Google Online Security Blog
Google Online Security Blog
罗磊的独立博客
L
LINUX DO - 最新话题
U
Unit 42
S
Security Affairs
有赞技术团队
有赞技术团队
WordPress大学
WordPress大学
博客园 - 【当耐特】
T
The Exploit Database - CXSecurity.com
S
Schneier on Security
月光博客
月光博客
Engineering at Meta
Engineering at Meta
腾讯CDC
F
Full Disclosure
Cyberwarzone
Cyberwarzone
S
SegmentFault 最新的问题
Recorded Future
Recorded Future
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
博客园 - 司徒正美
The Cloudflare Blog

秋水逸冰

丽萨主机:双ISP家宽住宅IP VPS/CN2 GIA精品网/G口大带宽 | 秋水逸冰 Linux Kernel 6.18.x 编译版 | 秋水逸冰 思考未来人与 AI 的关系 | 秋水逸冰 3X-UI 面板安装和使用教程 | 秋水逸冰 Xray-UI 面板安装和使用教程 | 秋水逸冰 WCMP (Windows + Caddy + MariaDB + PHP) Nginx for Windows | 秋水逸冰 Aria2 for Windows | 秋水逸冰 Curl for Windows | 秋水逸冰 Wget for Windows | 秋水逸冰 Windows 11 Enterprise LTSC DD 镜像 Windows Server 2025 Datacenter DD 镜像 tiny10 和 tiny11 23H2 的 Windows DD 镜像 从 Apache httpd 切换到 Caddy2 LCMP (Linux + Caddy + MariaDB + PHP) Windows 11 Pro for Workstations 22H2 DD 镜像 Shadowsocks 编译版 by Teddysun | 秋水逸冰 适用于 UEFI 启动的多个 Windows 系统 DD 镜像 Linux Kernel 5.15.x 编译版 | 秋水逸冰 制作适用于 WSL 的任意 Linux 镜像 Windows 11 Pro for Workstations 21H2 DD 镜像 Windows 10 Enterprise LTSC DD 镜像 Linux Kernel 5.14.x 编译版 | 秋水逸冰 Linux Kernel 5.13.x 编译版 | 秋水逸冰 Windows Server 2022 Datacenter DD 镜像 在 Windows 10 上安装 Rocky Linux 系统 Linux Kernel 5.12.x 编译版 | 秋水逸冰 Linux Kernel 5.11.x 编译版 | 秋水逸冰 在 Windows 10 上安装 CentOS 系统 Linux Kernel 5.10.x 编译版 | 秋水逸冰 Caddy v1.0.5 编译版 | 秋水逸冰 在 Windows 系统里轻松创建自定义服务 | 秋水逸冰 如何在 CentOS 8 下安装 Docker Engine 在 CentOS 7 下构建 Android 编译环境 使用 Docker Buildx 构建多种系统架构镜像 | 秋水逸冰 使用 Docker 快速部署 Shadowsocks-libev + v2ray-plugin 如何使用 FirewallD 开启 IP 白名单 WireGuard 一键安装脚本 | 秋水逸冰 域名那些事儿5 | 秋水逸冰 告别 | 秋水逸冰 Windows Server 2019/2016/2012R2 Datacenter DD 镜像 如何制作 Windows Server 2019 的 DD 镜像 介绍几款 Docker 镜像 | 秋水逸冰 如何启用 Shadowsocks 的多端口 | 秋水逸冰 一键安装KMS服务脚本 | 秋水逸冰 关于免费SSL证书的那些事儿 | 秋水逸冰 使用定时任务cron监视Shadowsocks进程 | 秋水逸冰 LAMP新增Letsencrypt支持 | 秋水逸冰 从编译到二进制安装 | 秋水逸冰 PHP模块一览及简要说明 | 秋水逸冰 使用 GPG 加密 Github Commits 一键安装最新内核并开启 BBR 脚本 | 秋水逸冰 Shadowsocks 一键安装脚本(四合一) | 秋水逸冰 FTP 上传一键脚本ftp_upload.sh | 秋水逸冰 限制 IP 访问 WordPress 登录画面 CentOS 6.10安装Python2.7.18 | 秋水逸冰 一键备份脚本backup.sh | 秋水逸冰 域名那些事儿4 | 秋水逸冰 域名那些事儿3 | 秋水逸冰 LAMP下SSL设置教程 | 秋水逸冰 L2TP/IPSec一键安装脚本 | 秋水逸冰 域名那些事儿2 | 秋水逸冰 一键测试脚本bench.sh | 秋水逸冰 解决pip安装M2Crypto失败的问题 | 秋水逸冰 在CentOS下编译安装GCC | 秋水逸冰 域名那些事儿 | 秋水逸冰 MySQL性能优化的简单说明 | 秋水逸冰 Zend Guard Loader简介及下载链接一览 | 秋水逸冰 Windows和Linux下Whois命令的安装和使用 | 秋水逸冰 LAMP一键安装脚本使用说明 | 秋水逸冰 Windows系统下安装dig命令 | 秋水逸冰 如何在Debian下安装Webmin | 秋水逸冰 Apache下部署SSL教程 | 秋水逸冰 Shadowsocks-go一键安装脚本 | 秋水逸冰 少壮不努力,一生在内地 | 秋水逸冰 Google日语输入法离线安装包 | 秋水逸冰 PHP加速缓存Zend Opcache | 秋水逸冰 CentOS下安装aria2教程 | 秋水逸冰 Linux多线程下载工具Axel | 秋水逸冰 phpMyAdmin导入文件错误的解决办法 | 秋水逸冰 PHP编译安装常见错误总结 | 秋水逸冰 phpMyAdmin从4.1.x升级到4.2.x注意事项 | 秋水逸冰 Debian下shadowsocks-libev一键安装脚本 | 秋水逸冰 CentOS下shadowsocks-libev一键安装脚本 | 秋水逸冰 又一家VPS:Vultr.com | 秋水逸冰 Linux系统中常用操作命令 | 秋水逸冰 Eclipse下搭建Python开发环境 | 秋水逸冰 Shadowsocks Python版一键安装脚本 | 秋水逸冰 Git初学者:msysgit和tortoisegit | 秋水逸冰 CentOS 6下编译PHP出错 | 秋水逸冰 Apache如何开启Gzip压缩 | 秋水逸冰 Linux Shell逻辑运算符和表达式详解 | 秋水逸冰 吐槽腾讯:PC用户也是用户 | 秋水逸冰 Webmin:如何安装Perl模块DBI和DBD-MySQL | 秋水逸冰 CentOS下如何手动添加Swap | 秋水逸冰 安装PHP的PDO MySQL扩展 | 秋水逸冰 Javascript获取URL参数值 | 秋水逸冰 总结我所用过的VPS商家 | 秋水逸冰 Apache索引(目录浏览)的那些事儿 | 秋水逸冰 如何新建最低权限的SSH帐号 | 秋水逸冰
重新编译 curl 以支持 HTTP3 | 秋水逸冰
秋水逸冰 · 2024-09-14 · via 秋水逸冰

从 2022 年 6 月 HTTP/3 的 RFC 发布,截至目前,常用的 Web Server,比如 Caddy Web ServerNginx 已经支持 HTTP/3。与此同时,常用的浏览器比如 Google Chrome,Microsoft Edge,Mozilla Firefox,Apple Safari 等也都开始支持 HTTP/3。这里吐槽一下,Apache httpd 支持 HTTP/3 还遥遥无期。
常用的 Client 软件比如 curl 其实也早已开始支持 HTTP/3,但是目前各大 Linux 发行版编译的 curl 都不包含 HTTP3 特性,故此我打算自己来。
本文主要详细讲述如何在下列 RHEL 系统中安装已经重新编译好的 curl,以及在编译 curl 中遇到的问题。
Enterprise Linux 8 (CentOS Stream 8, RHEL 8, Rocky Linux 8, AlmaLinux 8, Oracle Linux 8)
Enterprise Linux 9 (CentOS Stream 9, RHEL 9, Rocky Linux 9, AlmaLinux 9, Oracle Linux 9)
Enterprise Linux 10 (CentOS Stream 10, RHEL 10, Rocky Linux 10, AlmaLinux 10, Oracle Linux 10)

如何安装已经编译好的 curl


(以下均为使用 root 用户操作)
1. 开启 EPEL Repository
适用于 Enterprise Linux 8 (CentOS Stream 8, RHEL 8, Rocky Linux 8, AlmaLinux 8, Oracle Linux 8) 的安装命令

dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm

适用于 Enterprise Linux 9 (CentOS Stream 9, RHEL 9, Rocky Linux 9, AlmaLinux 9, Oracle Linux 9) 的安装命令

dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm

适用于 Enterprise Linux 10 (CentOS Stream 10, RHEL 10, Rocky Linux 10, AlmaLinux 10, Oracle Linux 10) 的安装命令

dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-10.noarch.rpm

2. 执行以下命令安装 Teddysun Linux Repository:
适用于 Enterprise Linux 8 (CentOS Stream 8, RHEL 8, Rocky Linux 8, AlmaLinux 8, Oracle Linux 8) 的安装命令

dnf install -y https://dl.lamp.sh/linux/rhel/el8/x86_64/teddysun-release-1.0-1.el8.noarch.rpm

适用于 Enterprise Linux 9 (CentOS Stream 9, RHEL 9, Rocky Linux 9, AlmaLinux 9, Oracle Linux 9) 的安装命令

dnf install -y https://dl.lamp.sh/linux/rhel/el9/x86_64/teddysun-release-1.0-1.el9.noarch.rpm

适用于 Enterprise Linux 10 (CentOS Stream 10, RHEL 10, Rocky Linux 10, AlmaLinux 10, Oracle Linux 10) 的安装命令

dnf install -y https://dl.lamp.sh/linux/rhel/el10/x86_64/teddysun-release-1.0-1.el10.noarch.rpm

3. 重建 Repository 缓存,执行如下命令:

dnf makecache

4. 通过 dnf 来安装重新编译的 curl,执行如下命令:

dnf install -y curl libcurl libcurl-devel

5. 通过 dnf 来升级 libnghttp2 和 c-ares 版本,执行如下命令:

dnf install -y libnghttp2 libnghttp2-devel c-ares c-ares-devel

dnf 会自动安装一些依赖包。安装成功后,查看 curl 的版本号,执行命令:curl -V
在 Enterprise Linux 8 (CentOS Stream 8, RHEL 8, Rocky Linux 8, AlmaLinux 8, Oracle Linux 8) 系统下,显示的是:

curl 8.20.0 (x86_64-redhat-linux-gnu) libcurl/8.20.0 OpenSSL/3.5.6 zlib/1.3.2 brotli/1.2.0 zstd/1.5.7 c-ares/1.34.6 libidn2/2.3.8 libpsl/0.21.5 libssh2/1.11.1 nghttp2/1.69.0 ngtcp2/1.23.0 nghttp3/1.16.0 libgsasl/1.10.0 mit-krb5/1.18.2 OpenLDAP/2.4.46
Release-Date: 2026-04-29
Protocols: dict file ftp ftps gopher gophers http https imap imaps ipfs ipns ldap ldaps mqtt mqtts pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp ws wss
Features: alt-svc asyn-rr AsynchDNS brotli gsasl GSS-API HSTS HTTP2 HTTP3 HTTPS-proxy HTTPSRR IDN IPv6 Kerberos Largefile libz NTLM PSL SPNEGO SSL SSLS-EXPORT threadsafe TLS-SRP UnixSockets zstd

在 Enterprise Linux 9 (CentOS Stream 9, RHEL 9, Rocky Linux 9, AlmaLinux 9, Oracle Linux 9) 系统下,显示的是:

curl 8.20.0 (x86_64-redhat-linux-gnu) libcurl/8.20.0 OpenSSL/3.5.5 zlib/1.3.2 brotli/1.2.0 zstd/1.5.7 c-ares/1.34.6 libidn2/2.3.8 libpsl/0.21.5 libssh2/1.11.1 nghttp2/1.69.0 ngtcp2/1.23.0 nghttp3/1.16.0 libgsasl/1.10.0 mit-krb5/1.21.1 OpenLDAP/2.6.8
Release-Date: 2026-04-29
Protocols: dict file ftp ftps gopher gophers http https imap imaps ipfs ipns ldap ldaps mqtt mqtts pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp ws wss
Features: alt-svc asyn-rr AsynchDNS brotli gsasl GSS-API HSTS HTTP2 HTTP3 HTTPS-proxy HTTPSRR IDN IPv6 Kerberos Largefile libz NTLM PSL SPNEGO SSL SSLS-EXPORT threadsafe TLS-SRP UnixSockets zstd

在 Enterprise Linux 10 (CentOS Stream 10, RHEL 10, Rocky Linux 10, AlmaLinux 10, Oracle Linux 10) 系统下,显示的是:

curl 8.20.0 (x86_64-redhat-linux-gnu) libcurl/8.20.0 OpenSSL/3.5.5 zlib/1.3.1.zlib-ng brotli/1.2.0 zstd/1.5.7 c-ares/1.34.6 libidn2/2.3.8 libpsl/0.21.5 libssh2/1.11.1 nghttp2/1.69.0 ngtcp2/1.23.0 nghttp3/1.16.0 libgsasl/1.10.0 mit-krb5/1.21.3 OpenLDAP/2.6.10
Release-Date: 2026-04-29
Protocols: dict file ftp ftps gopher gophers http https imap imaps ipfs ipns ldap ldaps mqtt mqtts pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp ws wss
Features: alt-svc asyn-rr AsynchDNS brotli gsasl GSS-API HSTS HTTP2 HTTP3 HTTPS-proxy HTTPSRR IDN IPv6 Kerberos Largefile libz NTLM PSL SPNEGO SSL SSLS-EXPORT threadsafe TLS-SRP UnixSockets zstd

5. 特性说明
在 Enterprise Linux 8 使用 OpenSSL/3.5.6 + ngtcp2/1.23.0 + nghttp3/1.16.0 作为后端支持 HTTP/3。
在 Enterprise Linux 9 使用 OpenSSL/3.5.5 + ngtcp2/1.23.0 + nghttp3/1.16.0 作为后端支持 HTTP/3。
在 Enterprise Linux 10 使用 OpenSSL/3.5.5 + ngtcp2/1.23.0 + nghttp3/1.16.0 作为后端支持 HTTP/3。
支持 rtmp, ws, wss 等 Protocol。
支持 brotli, gsasl, zstd 等 Feature。
编译了 curl 的各个依赖软件到最新版本。
6. 测试是否支持 HTTP/3
使用以下命令来查看是否支持 HTTP/3。

curl -I --http3 https://nghttp2.org/

返回值示例如下所示:

HTTP/3 200 
date: Sat, 04 Apr 2026 13:11:11 GMT
content-type: text/html
last-modified: Wed, 18 Mar 2026 12:01:59 GMT
etag: "69ba9437-18b4"
accept-ranges: bytes
content-length: 6324
x-backend-header-rtt: 0.001963
strict-transport-security: max-age=31536000
server: nghttpx
via: 2 nghttpx
x-frame-options: SAMEORIGIN
x-xss-protection: 1; mode=block
x-content-type-options: nosniff

第一行的 HTTP/3 200 就表示已经支持 HTTP/3。

在编译 curl 中遇到的问题

1. ngtcp2 和 nghttp3 的 rpm 不存在
开启 HTTP/3 特性需要 ngtcp2 和 nghttp3 来支持,但是目前并没有相关的 rpm,于是我参考了 nghttp2 的 spec 文件,自行制作了这两个依赖的 rpm 包。
ngtcp2 同时还需要 Crypto helper library 才能实现 QUIC 协议,目前受支持的 TLS 后端也就是如下列表:

quictls
GnuTLS >= 3.7.5
BoringSSL (commit e575a84d5f051483793b14c07b60720d0ed318b3); or aws-lc >= 1.39.0
Picotls (commit 34d4d6496cec80bc3b56dbdab45f21bd9fbc17aa)
wolfSSL >= 5.5.0
LibreSSL >= v3.9.2
OpenSSL >= 3.5.0

2. 默认安装的依赖软件版本比较旧
比如 brotli,zstd,libidn2,libpsl,libssh2,libgsasl,发行版自带的默认版本比较旧,补丁摞补丁,就是不升级版本(当然了,这是为了稳定性,毕竟是企业级系统,可以理解)。
对于自用,这些依赖升级了也不会出现大问题,至少目前还没发现。

3. 某些依赖软件不存在
比如 librtmp,这款软件名为 rtmpdump,属于 ffmpeg 项目下的一个 toolkit,用于支持 RTMP 流。在 RHEL 下默认就没有该 rpm 包,RpmFusion 里只有古老的版本。稀奇的是今年在其 git 里竟然更新了。
其最新 git commit log 是 v2.6 版本,结果编译出来的 library 和头文件还是 v2.3,于是只能自己写个补丁,把版本号改正过来,再制作编译 rpm 到最新版 2.6-1.20240301.git6f6bb13。
前前后后遇到不少问题,花了不少时间,总算是搞出来了。目前为止,自己用着挺满意,今天分享出来,希望大家也满意。

写在最后

请关注我的 Telegram 频道:https://t.me/qiushuiyibing
我会在此不定期发布一些杂七杂八的作品。
同时也欢迎加入交流群:https://t.me/qiushui2018

转载请注明:秋水逸冰 » 重新编译 curl 以支持 HTTP3