curl + openssl + ngtcp2 + nghttp3

curl + openssl + ngtcp2 + nghttp3 编译

#!/bin/sh -e
# build nghttp3 (for GitHub workflow)

git clone --depth 1 -b OpenSSL_1_1_1o+quic https://github.com/quictls/openssl
cd openssl
# For Linux
./config enable-tls1_3 --prefix=$PWD/build
make -j$(nproc)
make install_sw

cd ..
git clone https://github.com/ngtcp2/nghttp3
cd nghttp3
autoreconf -i
./configure --prefix=$PWD/build --enable-lib-only
make -j$(nproc) check
make install

cd ..
git clone https://github.com/ngtcp2/ngtcp2
cd ngtcp2
autoreconf -i
# For Mac users who have installed libev with MacPorts, append
# ',-L/opt/local/lib' to LDFLAGS, and also pass
# CPPFLAGS="-I/opt/local/include" to ./configure.
# For OpenSSL >= v3.0.0, replace "openssl/build/lib" with
# "openssl/build/lib64".
./configure PKG_CONFIG_PATH=$PWD/../openssl/build/lib/pkgconfig:$PWD/../nghttp3/build/lib/pkgconfig LDFLAGS="-Wl,-rpath,$PWD/../openssl/build/lib" --prefix=$PWD/build
make -j$(nproc) check
make install

cd ..
git clone https://github.com/curl/curl
cd curl
./buildconf
./configure --with-ssl=$PWD/../openssl/build/ --with-nghttp3=$PWD/../nghttp3/build/  --with-ngtcp2=$PWD/../ngtcp2/build/ --enable-alt-svc --prefix=$PWD/build
make -j$(nproc)
make install

测试

% ./curl --version
curl 7.84.0-DEV (x86_64-apple-darwin20.6.0) libcurl/7.84.0-DEV OpenSSL/1.1.1o zlib/1.2.11 brotli/1.0.9 libidn2/2.3.2 ngtcp2/0.6.0-DEV nghttp3/0.5.0-DEV librtmp/2.3
Release-Date: [unreleased]
Protocols: dict file ftp ftps gopher gophers http https imap imaps ldap ldaps mqtt pop3 pop3s rtmp rtsp smb smbs smtp smtps telnet tftp 
Features: alt-svc AsynchDNS brotli HSTS HTTP3 HTTPS-proxy IDN IPv6 Largefile libz NTLM NTLM_WB SSL TLS-SRP UnixSockets

参考

https://github.com/curl/curl/blob/master/docs/HTTP3.md
https://github.com/ngtcp2/ngtcp2
https://blog.csdn.net/u014023993/article/details/106131072
https://qing.su/article/157.html
https://zhuanlan.zhihu.com/p/444332157

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值