cloudflare / cloudflare/cloudflare-rs

Missing support for reqwest's rustls roots features

Open
#228 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
316
Forks
111
PR merge metrics
No merged PRs in 30d

Description

`cloudflare`'s `reqwest` dependency offers various [optional features](https://docs.rs/reqwest/latest/reqwest/#optional-features) to control which root certificates are used by reqwest. While some features such as [`default-tls` and `rustls-tls` have corresponding features in cloudflare's Cargo.toml](https://github.com/cloudflare/cloudflare-rs/blob/b4fa5ef8bb48415c54974ee3ed11cf9d8397d98b/cloudflare/Cargo.toml#L14-L15), the more fine-grained `rustls-tls-native-roots` (and `rustls-tls-webpki-roots`) are currently not supported.

This is problematic in projects that want to use Rustls with (only) the native roots and have `cloudflare` as dependency because the `rustls-tls` feature actually resolves to `rustls-tls-webpki-roots`.

Even more so, if a project uses `cloudflare` as dependency with the `rustls-tls` feature (which, as mentioned, resolves to `rustls-tls-webpki-roots`) and itself uses `reqwest` with the `rustls-tls-native-roots` feature, reqwest will actually use the root certificates from [both](https://github.com/seanmonstar/reqwest/blob/6792f697fcdb27c47dcbf7bd05f23368d1d4ac80/src/async_impl/client.rs#L465-L503) sources with Rustls because of how Cargo's feature unification works where [the union of all enabled features](https://doc.rust-lang.org/cargo/reference/features.html#feature-unification) is used on that dependency when building it.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.