-
Notifications
You must be signed in to change notification settings - Fork 595
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
Is there a way to use tokio + rustls +webpki-roots ? #1155
Comments
@djc do you know about this? |
There is a |
I did, I tried several combinations including
|
Right, but you can combine it with tokio features. I'm pretty sure that it's possible. |
Hi, Have you tried building with |
Hi ! Thanks for the answer. I re-read redis-rs Cargo.toml and I realized I misunderstood what was actually done. I assumed So if I am correct this time, I can use I guess I could live with that tradeoff. Isn't it a bit unfortunate to still depends on |
No, I'm pretty sure you can make do without the "dead" dependency. |
If the dependency itself is problematic, you're more than welcome to open a PR that removes this dependency when using webpki. I'm not a |
@djc if you have any tips on how to do that without enabling the @nihohit I will give it a try.
I am not quite sure how these features currently interact with
But I am not entirely sure how difficult it would be. |
I agree that the feature setup isn't great here in that |
I may be wrong and I don't claim to be an expert on the matter but I am pretty confident I do know how Cargo features work. I am in particular aware of the fact that features are not only used to enable optional dependencies but are also usually used in rust code to control conditional compilation. I can indeed make redis-rs compile with the set of features you suggested and it will appear to work because it includes However, regarding rustls, you only enable dep-features that are not used as switch in rust code for conditional compilation. The result would be that all rustls related crate you included will be downloaded by cargo but they won't actually be used by redis-rs since we wont trigger any of the compilation conditions in rust code such as This is made obvious if you run it through clippy while enabling $ cargo clippy -F rustls -F rustls-pemfile -F rustls-pki-types -F tokio-comp -F tokio-rustls -F webpki-roots -- -W unused_crate_dependencies
Checking redis v0.25.3 (/home/afe/Dev/redis-rs/redis)
warning: external crate `rustls` unused in `redis`: remove the dependency or add `use rustls as _;`
|
= note: requested on the command line with `-W unused-crate-dependencies`
warning: external crate `rustls_pemfile` unused in `redis`: remove the dependency or add `use rustls_pemfile as _;`
warning: external crate `rustls_pki_types` unused in `redis`: remove the dependency or add `use rustls_pki_types as _;`
warning: external crate `tokio_rustls` unused in `redis`: remove the dependency or add `use tokio_rustls as _;`
warning: external crate `webpki_roots` unused in `redis`: remove the dependency or add `use webpki_roots as _;`
warning: `redis` (lib) generated 5 warnings |
If you know how Cargo features work, then I'm surprised you could not come up with the set of features I listed yourself. It does indeed seem that the feature setup here is broken. |
@nihohit I created a PR as you suggested. By the way, I think |
* Java: Add `Time()` command (redis-rs#145) * Add Time() command to Java client Signed-off-by: Andrew Carbonetto <andrew.carbonetto@improving.com> --------- Signed-off-by: Andrew Carbonetto <andrew.carbonetto@improving.com> * Javadoc update Signed-off-by: Andrew Carbonetto <andrew.carbonetto@improving.com> * Clean javadoc Signed-off-by: Andrew Carbonetto <andrew.carbonetto@improving.com> * Remove warning in unit test for time() Signed-off-by: Andrew Carbonetto <andrew.carbonetto@improving.com> --------- Signed-off-by: Andrew Carbonetto <andrew.carbonetto@improving.com>
Hi!
I am looking for a way to use this crate with tokio and rustls (so basically
tokio-rustls-comp
feature) but I would like to usewebpki-roots
instead ofrustls-native-certs
. I want this specific setup because that is what I use in every other tls setup in my project and because my goal is to run my service in a very minimal environment (ideally without openssl and without local certificates).redis-rs seem to support using
webpki-roots
only in a sync context but not withtokio
. I do not think there is any specific reason behind that, it only seems to be an unwanted consequence of the way features are split and combined.Could anyone please confirm that it is indeed not currently possible? And if so, do you think we could rework current features to make it possible?
The text was updated successfully, but these errors were encountered: