You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've just started using Tungstenite and ran into an issue trying to support secure sockets.
The documentation says that to support WSS, you need to use native-tls or rustls-tls feature flags. I wanted to use the latter, but I noticed that the feature flag rustls-tlsdoesn't exist anymore. This led me to guess correcting it to rustls, which works because Cargo makes optional dependencies available as features implicitly (not something I'm a fan of, but here we are). However, this then meant that while everything compiled and ran, I would always have my connection refused with 400: bad request. Everything worked once I changed my feature selection to rustls-tls-webpki-roots, but it took a lot of head-scratching to work out that was the solution, as I hadn't used websockets before and didn't know what was going wrong (was it me, the API, or the library?).
A couple suggestions off the back of my experience, if I may:
Update the connect documentation to include the up-to-date rustls-related feature flags
Consider maybe triggering a compile error if compiling with not all the dependencies of a valid feature selection e.g. compiling with rustls but not webpki
I could look to write the PR if you'd like, just wanted to know your thoughts first :)
The text was updated successfully, but these errors were encountered:
alpha-tango-kilo
changed the title
Prevent/Mitigate footguns with implicit dependencies
Prevent/Mitigate footguns with implicit features
Apr 19, 2022
We've documented the usage of features in the README 🙂 Unfortunately we've forgotten to update the documentation on connect(). E.g. we need to update it, thanks for noticing it.
daniel-abramov
changed the title
Prevent/Mitigate footguns with implicit features
Update the documentation for connect() method to include the actual information of the TLS features
Apr 19, 2022
Hi there!
I've just started using Tungstenite and ran into an issue trying to support secure sockets.
The documentation says that to support WSS, you need to use
native-tls
orrustls-tls
feature flags. I wanted to use the latter, but I noticed that the feature flagrustls-tls
doesn't exist anymore. This led me to guess correcting it torustls
, which works because Cargo makes optional dependencies available as features implicitly (not something I'm a fan of, but here we are). However, this then meant that while everything compiled and ran, I would always have my connection refused with 400: bad request. Everything worked once I changed my feature selection torustls-tls-webpki-roots
, but it took a lot of head-scratching to work out that was the solution, as I hadn't used websockets before and didn't know what was going wrong (was it me, the API, or the library?).A couple suggestions off the back of my experience, if I may:
connect
documentation to include the up-to-daterustls
-related feature flagsrustls
but notwebpki
I could look to write the PR if you'd like, just wanted to know your thoughts first :)
The text was updated successfully, but these errors were encountered: