Add `rustls_ring` feature flag to support WSS on native
- Provides a feature flag to enable ring to serve as a default crypto provider
- Ensures that tls support is still provided even if tokio is enabled. Closes: #57
I'm was looking over my comment and found the error message looked wrong. It was wrong. I used https instead of wss. https still works correctly in the browser but not native. I commented out the code you referenced above and... it still worked. So I went back to main and tried again and... it's back to not working on native (the browser still works). It panics on with the following message on native:
thread 'ewebsock' panicked at /home/one/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rustls-0.23.7/src/cr
ypto/mod.rs:260:14:
no process-level CryptoProvider available -- call CryptoProvider::install_default() before this point
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
I honestly don't really understand but it seems I only need to bring in the dependency and that's sufficient for it to work so that's easy and I just put it directly into ewebsocket behind a feature flag and added a note to the documentation.
I also added documentation for the tls feature to the best of my ability, not sure if it had been intentionally not documented.
Let me know if you want me to squash the commits. I should also mention that there is another provider but I didn't try that one as it sounded more complicated in their docs.
Given the recent news related to ring (RUSTSEC-2025-0007). I think it makes sense to change the feature to use a different provider.
~~Will try to update once I get a chance but can't find how to set the pr to draft on the mobile client in the meantime.~~
PR Set to draft.
The advisory has been withdrawn and others have stepped up to help.
The following extract from cargo tree shows the duplicate versions causing CI to fail for cargo-deny
echo_server v0.1.0 (/workspaces/ewebsock/echo_server)
└── tungstenite v0.24.0
└── rustls-native-certs v0.7.3
ewebsock v0.8.0 (/workspaces/ewebsock/ewebsock)
└── tokio-tungstenite v0.24.0
└── rustls-native-certs v0.8.0