-
Notifications
You must be signed in to change notification settings - Fork 173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
client: feature gate tls cert store #994
Conversation
#[cfg(not(feature = "__tls"))] | ||
Some("http") => Client::new(), | ||
#[cfg(all(feature = "__tls", feature = "native-tls", feature = "webpki-tls"))] | ||
Some("https") | Some("http") => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for simplicity, just use connector based on the feature flag and yes the https connector is a bit slower on plain http than http connector.
native-tls = ["hyper-rustls/native-tokio", "__tls"] | ||
webpki-tls = ["hyper-rustls/webpki-tokio", "__tls"] | ||
|
||
__tls = ["hyper-rustls"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm happy with this for clarity, but just noting that as it stands, hyper-rustls
will automatically be bought in when native-tls
or webpki-tls
is enabled without needing it :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah but it's useful to reference this in the code, I see!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, LGTM! (personally I have no opinion or issue with the feature name choices!)
…ate-tls-cert-store
Currently, the clients will include dependencies for both
webpki
andnative
certificate store which can be configured at runtime but that leads to a bigger dependency tree.IIRC, I did it like this to avoid having "mutually exclusive feature" but I looked at the reqwest API and having these APIs behind a feature flag looks clean to me.
No default features implies -> no TLS