Skip to content

curl: enable HTTP/3 support by default #435914

Merged
emilazy merged 6 commits intoNixOS:stagingfrom
NyCodeGHG:curl-http3
Sep 21, 2025
Merged

curl: enable HTTP/3 support by default #435914
emilazy merged 6 commits intoNixOS:stagingfrom
NyCodeGHG:curl-http3

Conversation

@NyCodeGHG
Copy link
Member

See https://curl.se/docs/http3.html

Things done

  • Built on platform:
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested, as applicable:
  • Ran nixpkgs-review on this PR. See nixpkgs-review usage.
  • Tested basic functionality of all binary files, usually in ./result/bin/.
  • Nixpkgs Release Notes
    • Package update: when the change is major or breaking.
  • NixOS Release Notes
    • Module addition: when adding a new NixOS module.
    • Module update: when the change is significant.
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other READMEs.

Add a 👍 reaction to pull requests you find important.

@nixpkgs-ci nixpkgs-ci bot added 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS labels Aug 22, 2025
@Izorkin
Copy link
Contributor

Izorkin commented Aug 22, 2025

If I'm not mistaken, OpenSSL's implementation of the QUIC protocol has performance issues compared to QuicTLS.

@NyCodeGHG
Copy link
Member Author

If I'm not mistaken, OpenSSL's implementation of the QUIC protocol has performance issues compared to QuicTLS.

But isn't this using ngtcp2 for QUIC and only OpenSSL for crypto?
Or am I misunderstanding some of the build options?

@Izorkin
Copy link
Contributor

Izorkin commented Aug 25, 2025

But isn't this using ngtcp2 for QUIC and only OpenSSL for crypto?
Or am I misunderstanding some of the build options?

The ngtcp2 package supports OpenSSL 3.5 only through the libngtcp2_crypto_ossl helper library. I don't think this is full support.
I would prefer to use quictls in curl by default, but no one will agree to that - #179579

@alois31
Copy link
Contributor

alois31 commented Aug 31, 2025

The ngtcp2 package supports OpenSSL 3.5 only through the libngtcp2_crypto_ossl helper library. I don't think this is full support.

According to both the documentation and what I have observed during builds, ngtcp2 uses a helper library for all cryptography libraries. It is true that quictls uses a different one (aptly called libngtcp2_crypto_quictls) and that the OpenSSL one has some extra requirements on its use that are documented there. However the only consumer of the quictls-using ngtcp2 in nixpkgs is curl, which documents building ngtcp2 against OpenSSL upstream without extra warnings, so I assume it is fine.

I would prefer to use quictls in curl by default, but no one will agree to that - #179579

For reasons that have only become better since then. The released quictls is unmaintained and had its last release 11 months ago, and OpenSSL in the meantime had several security-relevant changes such as vulnerability fixes and the introduction of ML-KEM support in 3.5 (for hybrid post-quantum key exchange support). Meanwhile the supposed replacement has no release at all yet, and with upstream OpenSSL improving their QUIC support the case for QuicTLS does not look to get more compelling.

Copy link
Member

@emilazy emilazy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like a good idea, as discussed on Matrix.

I agree that ngtcp2 + OpenSSL 3.5 seems like the obvious route here. AIUI, it does not have the issues of OpenSSL’s native QUIC implementation.

Copy link
Member

@Scrumplex Scrumplex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes LGTM. Thanks for making sure that every commit still evaluates.

@nixpkgs-ci nixpkgs-ci bot added 12.approvals: 1 This PR was reviewed and approved by one person. 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in any of the changed packages. labels Sep 10, 2025
@Izorkin
Copy link
Contributor

Izorkin commented Sep 16, 2025

Now Samba package with QUIC support based on ngtcp2 library has been released. Probably soon QUIC module for Linux kernel will be released. And none of them support OpenSSL's QUIC implementation.

If necessary, quictls can be replaced with wolfSSL, BoringSSL, aws-lc or libressl.

@NyCodeGHG
Copy link
Member Author

@Izorkin I'm not sure I understand what you are suggesting. This PR also uses ngtcp2 (and OpenSSL for crypto) for curl's http/3 support

@Izorkin
Copy link
Contributor

Izorkin commented Sep 16, 2025

This PR release changes the QUIC protocol implementation in ngtcp2 from OpenSSL 3.5, which is not supported by other projects. This may lead to bugs.

@NyCodeGHG
Copy link
Member Author

ngtcp2 + OpenSSL seems to be still marked as experimental, not sure if we actually want to ship this then
https://github.com/ngtcp2/ngtcp2/blob/2334b653df8a8ec9bafe6a1f2bf3ed30db6e9ef1/README.rst?plain=1#L69

@alois31
Copy link
Contributor

alois31 commented Sep 20, 2025

Samba already builds against GnuTLS, so it would probably use ngtcp2-gnutls, in which case it doesn't matter at all what TLS library the main ngtcp2 package uses. I do not know about the kernel module, but would be very surprised if it depended at all on the ngtcp2 userspace library. Indeed I should have been clearer in the previous comment about the experimental status, however it is not so clear to me what to make of that given that curl (the only user of the ngtcp2 package) documents building ngtcp2 against OpenSSL without this disclaimer.

@emilazy
Copy link
Member

emilazy commented Sep 20, 2025

If necessary, quictls can be replaced with wolfSSL, BoringSSL, aws-lc or libressl.

From reading the curl configure.ac, It seems like these would require switching the main TLS library used by curl; it cannot use ngtcp2 + AWS‐LC for HTTP/3 while using OpenSSL for everything else, say.

So this would be a question of changing the default TLS library used by curl in general. GnuTLS we would rather get rid of as much as possible, LibreSSL lags behind OpenSSL these days, BoringSSL comes with no stability promises and is disclaimed by its upstream as unsuitable for general‐purpose use. The only palatable options would seem to be wolfSSL or AWS‐LC. AWS‐LC is in the OpenSSL fork family and already moderately load‐bearing for Rust stuff, so likely to be the most viable choice here.

Still, though, I am sceptical we would want to make that switch when we use OpenSSL so extensively anyway. curl and nghttp2 are the only consumers of our ngtcp2 package and curl seems to prefer the ngtcp2 + OpenSSL combination. It’s also the only option they’re giving CodeQL coverage in CI, for instance. I think the choice here is clear if we want to enable HTTP/3 support by default, which I think we do.

(After writing this, I see that it appears the CMake build of curl can support multiple TLS libraries, but it is explicitly not supported with HTTP/3. Even if it was, I’m not sure we’d want two of them in the closure with the attendant additional security exposure, and we don’t use the CMake build of curl anyway.)

@nixpkgs-ci nixpkgs-ci bot added the 2.status: merge conflict This PR has merge conflicts with the target branch label Sep 20, 2025
@nixpkgs-ci nixpkgs-ci bot removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Sep 20, 2025
@Izorkin
Copy link
Contributor

Izorkin commented Sep 20, 2025

Maybe then should create a separate package ngtcp2-openssl and use it?

@emilazy
Copy link
Member

emilazy commented Sep 20, 2025

And have no ngtcp2? It’s a bit awkward with by-name. OpenSSL is the TLS library we use as a default throughout the system, so it makes sense as a default here.

Copy link
Member

@emilazy emilazy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed that curl --http3-only https://google.com/ works on aarch64-darwin.

@nixpkgs-ci nixpkgs-ci bot added 12.approvals: 2 This PR was reviewed and approved by two persons. and removed 12.approvals: 1 This PR was reviewed and approved by one person. labels Sep 20, 2025
@emilazy emilazy merged commit 6607ec3 into NixOS:staging Sep 21, 2025
30 of 32 checks passed
@NyCodeGHG NyCodeGHG deleted the curl-http3 branch September 21, 2025 07:41
@NyCodeGHG
Copy link
Member Author

Maybe relevant question from curl maintainer Daniel Stenberg: https://curl.se/mail/lib-2025-10/0000.html

@alois31
Copy link
Contributor

alois31 commented Oct 1, 2025

This does not appear relevant, as it relates to --enable-openssl-quic. Some other distributions use that but for nixpkgs you enabled ngtcp2.

@NyCodeGHG
Copy link
Member Author

Not related directly to this PR, yes, but to OpenSSL QUIC and curl

semgrep-ci bot pushed a commit to semgrep/semgrep that referenced this pull request Oct 22, 2025
There's some issue with updating the nix flake. In the meantime this
bumps opam-repository so we can pull some new dependencies in other PRs.

Original issue seems to be caused by
NixOS/nixpkgs#435914

Test plan:
nix ci passes

synced from Pro 0cc7059429d452056ab22dc7e2dbde771dd2534d
semgrep-ci bot pushed a commit to semgrep/semgrep that referenced this pull request Oct 23, 2025
There's some issue with updating the nix flake. In the meantime this
bumps opam-repository so we can pull some new dependencies in other PRs.

Original issue seems to be caused by
NixOS/nixpkgs#435914

Test plan:
nix ci passes

synced from Pro 0cc7059429d452056ab22dc7e2dbde771dd2534d
semgrep-ci bot pushed a commit to semgrep/semgrep that referenced this pull request Oct 23, 2025
There's some issue with updating the nix flake. In the meantime this
bumps opam-repository so we can pull some new dependencies in other PRs.

Original issue seems to be caused by
NixOS/nixpkgs#435914

Test plan:
nix ci passes

synced from Pro 0cc7059429d452056ab22dc7e2dbde771dd2534d
dijkstracula pushed a commit to semgrep/semgrep that referenced this pull request Oct 23, 2025
There's some issue with updating the nix flake. In the meantime this
bumps opam-repository so we can pull some new dependencies in other PRs.

Original issue seems to be caused by
NixOS/nixpkgs#435914

Test plan:
nix ci passes

synced from Pro 0cc7059429d452056ab22dc7e2dbde771dd2534d
AlexLaroche pushed a commit to AlexLaroche/semgrep that referenced this pull request Nov 16, 2025
There's some issue with updating the nix flake. In the meantime this
bumps opam-repository so we can pull some new dependencies in other PRs.

Original issue seems to be caused by
NixOS/nixpkgs#435914

Test plan:
nix ci passes

synced from Pro 0cc7059429d452056ab22dc7e2dbde771dd2534d
@Izorkin
Copy link
Contributor

Izorkin commented Jan 19, 2026

@alois31
Copy link
Contributor

alois31 commented Jan 19, 2026

Again, this is not relevant, because nixpkgs uses ngtcp2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. 12.approvals: 2 This PR was reviewed and approved by two persons. 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in any of the changed packages.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants