Add configurable TLS feature flags for reqwest - #43
Merged
Conversation
Exposes reqwest's TLS backend options as crate features so users with self-signed or corporate CA certificates (e.g. Keycloak on a homelab) can opt into native-tls or rustls with native roots without needing to declare a direct reqwest dependency. - default = ["rustls-tls"] preserves existing behaviour - rustls-tls-native-roots: rustls using the OS certificate store - native-tls: OS-native TLS stack (trusts system cert store) - native-tls-vendored: statically-linked native TLS Closes #41 https://claude.ai/code/session_014PcmRepV7DMLBi2TnVfoPo
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #43 +/- ##
=======================================
Coverage 88.29% 88.29%
=======================================
Files 3 3
Lines 547 547
=======================================
Hits 483 483
Misses 64 64 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Summary
This change introduces configurable TLS feature flags to allow users to choose their preferred TLS implementation when using this library, rather than being locked into rustls-tls.
Key Changes
[features]section to Cargo.toml with multiple TLS options:rustls-tls(default): Uses rustls with system rootsrustls-tls-native-roots: Uses rustls with native certificate rootsnative-tls: Uses the platform's native TLS implementationnative-tls-vendored: Uses vendored native TLSreqwestdependency to remove the hardcodedrustls-tlsfeatureImplementation Details
rustls-tlsto maintain backward compatibilityreqwestdependency now only explicitly requires thejsonfeature, with TLS features being optional and controlled by this crate's feature flagshttps://claude.ai/code/session_014PcmRepV7DMLBi2TnVfoPo