Repository navigation
Conversation
HTTP/3 through libcurl's ngtcp2 backend on OpenSSL's QUIC API, which needs OpenSSL 3.5 or newer. ngtcp2 (v1.25.0) and nghttp3 (v1.18.0) come in as submodules and are compiled with cc like libcurl itself: their version.h is generated from the cmake template, the handful of HAVE_* defines their cmake configure would find is set per platform. No cmake, no bindgen, no new crates. The feature implies ssl and static-curl. With rustls or on Windows it only warns and does nothing, so --all-features keeps building. An OpenSSL older than 3.5 stops the build with a message that points at static-ssl. sendmmsg stays off: libcurl's mmsg path needs _GNU_SOURCE for struct mmsghdr and IOV_MAX, which this build does not define. Also adds CURL_HTTP_VERSION_3ONLY.
HttpVersion::V3Only (CURL_HTTP_VERSION_3ONLY) fails instead of falling back to HTTP/2 or 1.1, which is what makes an HTTP/3 test meaningful. examples/http3.rs fetches cloudflare-quic.com that way; a CI job builds the feature with static-ssl and runs the example.
The weekly job that bumps the curl submodule to the latest release now runs as a matrix over curl, ngtcp2 and nghttp3, one pull request each, so the http3 feature does not add a library that nobody updates.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds an
http3feature that builds libcurl with HTTP/3, so a static Rust binary gets QUIC with one line in Cargo.toml:How
libcurl's ngtcp2 backend on OpenSSL's own QUIC API (
OPENSSL_QUIC_API2, OpenSSL 3.5+). ngtcp2 v1.25.0 and nghttp3 v1.18.0 come in as submodules undercurl-sys/and are compiled by the build script withcc, the same way libcurl itself is:version.his generated from their cmake templates, the fewHAVE_*defines their configure would find are set per platform. No cmake, no bindgen, no new dependency crates; the existingnghttp3-sys/ngtcp2-syscrates on crates.io are hard-wired to aws-lc and need bindgen, which did not fit this crate.http3impliessslandstatic-curl. Withrustlsor on Windows the feature only prints a warning and does nothing, so--all-features(and the docs job) keeps building. An OpenSSL older than 3.5 fails the build with a message pointing atstatic-ssl; Ubuntu 24.04's 3.0 is such a case, which is why the CI job and the example usestatic-ssl.Also
HttpVersion::V3Only/CURL_HTTP_VERSION_3ONLY: fail instead of falling back, so a test actually proves HTTP/3.examples/http3.rsfetches https://cloudflare-quic.com/ withV3Only.--features http3,static-ssland runs the example.Tested
Linux x86_64, OpenSSL 3.6.3 from
openssl-src:cargo run --example http3 --features http3,static-sslprints the page and200 over HTTP/3.cargo test --features http3,static-sslpasses.cargo check --no-default-features --features http3,rustlsbuilds with the warning.Not covered: macOS and the BSDs (the endian defines are set for them but untested), and HTTP/3 through a proxy.
sendmmsgis left off because libcurl's mmsg path needs_GNU_SOURCE, which this build does not set;sendmsgis the portable path.Related: #687 (rustls-ring, CA probing) is independent of this.