magic-wormhole.rs icon indicating copy to clipboard operation
magic-wormhole.rs copied to clipboard

async-tungstenite: Make TLS features optional

Open felinira opened this issue 10 months ago • 5 comments

The included TLS features are only required for wss connections to the mailbox server which not required by the protocol and only really useful for wasm builds.

Closes #216

felinira avatar Apr 22 '24 14:04 felinira

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 39.24%. Comparing base (6082d8b) to head (7366377).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #222   +/-   ##
=======================================
  Coverage   39.24%   39.24%           
=======================================
  Files          18       18           
  Lines        3088     3088           
=======================================
  Hits         1212     1212           
  Misses       1876     1876           

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Apr 22 '24 15:04 codecov[bot]

Either way we need a way to select the backend here. I would personally choose native TLS for example, to get rid of rustls and ring. I can make it a default feature instead.

wss support doesn't really give us much though, does it? What advantage do we have from connecting to a server via wss? From what I gathered the reason for wss support is mostly due to wasm requirements?

felinira avatar Apr 22 '24 18:04 felinira

wss support doesn't really give us much though, does it?

Not really, it's already end-to-end encrypted in the protocol itself (and authenticated).

I believe at least part of the point of the default server being TCP-only is to prove this point (although I've not seen this written down anywhere by Brian).

meejah avatar Apr 23 '24 13:04 meejah

I'll leave it out of default features for now. Cargo doesn't support target-specific default features so we can't auto-enable it on wasm either (wasm being the only place where it makes sense to both enable it by default, and native tls doesn't exist)

felinira avatar Apr 24 '24 20:04 felinira

Yes, typically WASM will require wss://

meejah avatar Apr 24 '24 20:04 meejah