websockets-rs / rust-websocket

A WebSocket (RFC6455) library written in Rust
http://websockets-rs.github.io/rust-websocket/
MIT License
1.55k stars 223 forks source link

Support rustls for easier cross compiling #238

Open shekohex opened 5 years ago

shekohex commented 5 years ago

Hi :wave:

TL;DR: i'm currently using this great crate in my projects (as a client for now) and recently i had to containerize my package into (docker container), that is not a problem, the problem is i want to use musl libc so i can build a static minimum bare-metal image.

using rustls would make cross compiling a way better, so any plans to support it under a feature flag ? maybe async-rustls and sync-rustls ?

Thank you all for your great work :+1:

MightyPork commented 5 years ago

I'm currently in a situation where having native-tls breaks compatibility with different target machines (different versions of Debian), and removing the OpenSSL dependency is the only fix, beside trying to build and link OpenSSL statically. This would be an extremely welcome addition.

For now I work around the problem by disabling the tls feature in this crate altogether, but I'm certain it will be needed later. You may find the related reqwest issue and PR of interest.

Thanks for the crate, it's really useful.

timvisee commented 4 years ago

I'd like RusTLS support as well for use in ffsend-api.

Any plans for this?

vi commented 4 years ago

Any plans for this?

Theoretically yes, but in practice this crate is only seldomly and passively maintained.

Have you tried another WebSocket solutions for Rust?

By leveraging websocket-base you can also use rust-websocket on top of arbitrary underlying protocols (such as UNIX domain sockets), so it can be used to integrate it with rustls. Or maybe it can be done even without websocket-base...

victorpaleologue commented 2 years ago

Have you tried another WebSocket solutions for Rust?

Would you recommend one, please?

Theoretically yes, but in practice this crate is only seldomly and passively maintained.

Can we do something about it?

victorpaleologue commented 2 years ago

I got a secure websocket working using tokio-tungstenite, with the rustls feature enabled.

vi commented 2 years ago

Websocat3 (a work in progress, not the recommended build of Websocat) indeed uses tokio-tungstenite and can be built with Rustls (in fact, some of pre-build executables in Github Releases are built with Rustls).

Websocat1 is unlikely to gain Rustls support.