-
Notifications
You must be signed in to change notification settings - Fork 240
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
Clarification regarding CryptoProvider
#353
Comments
We follow the semver to indicate breaking changes, but it's true that we did not specifically describe what must be called from the
Did you have a chance to check suggestions from other users? AFAIR the fix was mentioned a couple of times across different issues and solved the problem for those affected. If I'm following you right, I assume you suggest including the information about that line of code ( |
Hi @daniel-abramov, thanks for taking the time!
Yes, but there were multiple solutions mentioned, and most of them mention adding random additional dependencies and code, but none explained why. From what I read I understand that I can add Is this behavior that changed in the latest |
After some digging & experimentation, I think I have a more complete understanding of the issue now :-)
Now in my case, two crates I use depend on
Which one is the "correct way to do things" ™️ is another discussion. If I understand the TL;DR for people that don't care and just want to fix their app:
Regarding
I (incorrectly) assumed there was a straight-forward, singular solution to the issue. Thanks for rubber-ducking! |
You're right that it's a bit perplexing, especially for users unfamiliar with Meanwhile, I've added a small note to the README that links this discussion, so hopefully, it will make it less confusing! |
Just a quick comment, I ran into this issue today and after some back and forth, the following solved the problem for me: In Cargo.toml rustls = { version = "0.23.17", features = ["ring"] }
tokio-tungstenite = { version = "0.24.0", features = ["rustls-tls-webpki-roots"]} And then in main.rs #[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// https://github.com/snapview/tokio-tungstenite/issues/353
rustls::crypto::ring::default_provider().install_default().expect("Failed to install default rustls crypto provider");
...
} I cross compile to multiple targets and this setup works reliably on all of them. |
From the discussions in #336 and #339 it is unclear what users are supposed to do now; nor is there any mention of this (breaking) change in the CHANGELOG; nor does the documentation say anything about it.
Unfortunately the note
does not help for someone that never used rustls directly :)
The text was updated successfully, but these errors were encountered: