Skip to content
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

Update the documentation for connect() method to include the actual information of the TLS features #280

Closed
alpha-tango-kilo opened this issue Apr 19, 2022 · 1 comment

Comments

@alpha-tango-kilo
Copy link

alpha-tango-kilo commented 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 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 :)

@alpha-tango-kilo alpha-tango-kilo changed the title Prevent/Mitigate footguns with implicit dependencies Prevent/Mitigate footguns with implicit features Apr 19, 2022
@daniel-abramov
Copy link
Member

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 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
a-miyashita pushed a commit to givery-technology/tungstenite-rs that referenced this issue Jul 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants