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.…