- 参考网址
HTTP/3 with curlhttps://curl.se/docs/http3.html
- quiche源码地址
https://github.com/cloudflare/quiche
- boring_ssl地址 (放到quiche/quiche/deps/boringssl/)
https://github.com/google/boringssl.git
- 安装cmake
apt install cmake
- 安装其他工具
apt install autoconf
apt install libtool
- 安装go语言
apt install golang
- rust cargo配置http代理
https://blog.youkuaiyun.com/xieyou/article/details/125830138
- 编译quiche
cd quiche/
cargo build --package quiche --release --features ffi,pkg-config-meta,qlog
mkdir quiche/deps/boringssl/lib
ln -vnf $(find target/release -name libcrypto.a -o -name libssl.a) quiche/deps/boringssl/lib/
如果编译过程中报找不到libcrypto和libssl,则需要修改quiche/src/build.rs
println!("cargo:rustc-link-search=native={}", build_dir);
修改为
println!("cargo:rustc-link-search=native={}/crypto", build_dir);
println!("cargo:rustc-link-search=native={}/ssl", build_dir);
需要删除或重命名target/release/libquiche.so,否则在编译curl时执行configure命令会失败,打开config.log可以看到如下报错
/usr/bin/ld: conftest: hidden symbol `X509_STORE_CTX_init' in /code/curl-7.84.0/../quiche-0.14.0/quiche/deps/boringssl//lib/libcrypto.a(x509_vfy.c.o) is referenced by DSO
- 编译curl
#下载代码
git clone https://github.com/curl/curl
#编译
autoreconf -fi
./configure LDFLAGS="-Wl,-rpath,$PWD/../quiche-0.14.0/target/release" --with-openssl=$PWD/../quiche-0.14.0/quiche/deps/boringssl/ --with-quiche=$PWD/../quiche-0.14.0/target/release
make