Menu

1 / 2

Post-quantum TLS in Rust: reqwest does not prefer it by default

DEV Community: rust·Stormedo·about 17 hours ago
#KCtjsqOE
#devtorust#devto#dev#rustls#x25519mlkem768
Long article (1639 words) — no AI summary yet.
Reading 0:00
15s threshold

reqwest 0.13.4 with its default rustls backend supports the hybrid post-quantum key exchange X25519MLKEM768, but offers it last. Servers that prefer the hybrid have to ask for it with a HelloRetryRequest, which costs an extra round trip, and some servers settle on plain X25519 instead. The fix is one dependency line:

cargo add [email protected] --no-default-features --features prefer-post-quantum

Enter fullscreen mode

Exit fullscreen mode

Cargo merges features across the dependency graph, so the rustls that reqwest uses gets prefer-post-quantum too and offers X25519MLKEM768 first. Use the rustls version your lockfile already has, so there is still one copy of rustls in the build.

Everything below applies to reqwest 0.13.4 and rustls 0.23.41 with the aws-lc-rs provider. reqwest 0.12 is different and has its own section near the end.

What X25519MLKEM768 is and why it matters now

Every TLS 1.3 connection starts with a key exchange that agrees on the keys for the session.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.