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

Split TlsStream like TcpStream #84

Open
jmmaloney4 opened this issue Sep 16, 2024 · 3 comments
Open

Split TlsStream like TcpStream #84

jmmaloney4 opened this issue Sep 16, 2024 · 3 comments

Comments

@jmmaloney4
Copy link

Tokio allows splitting a TcpStream into a (Owned)ReadHalf / (Owned)WriteHalf via TcpStream::split / TcpStream::into_split, but I don't believe tokio_rustls allows splitting a TlsStream that wraps a TcpStream. Is there a way to do this with the current API that I'm not thinking of? If not, I'd be interested in helping to implement this feature.

The split method in TcpStream above is not the same as tokio::io::split. It supports true simultaneous reads and writes as opposed to just locking around the syscalls.

@cpu
Copy link
Member

cpu commented Sep 16, 2024

I believe the Deno folks have worked on something in this space: https://github.com/denoland/rustls-tokio-stream that might be a useful comparison point.

There's some previous discussion in an issue that was created when the Rustls specific code lived alongside the native-tls code in tokio-rs/tls#40

@quininer
Copy link
Member

@cpu tokio-rustls is not affected by tokio-rs/tls#40 .

Any split stream based on rustls must be locked until rustls support full-duplex mode. rustls/rustls#288

@cpu
Copy link
Member

cpu commented Sep 17, 2024

@cpu tokio-rustls is not affected by tokio-rs/tls#40 .

Ah! Thanks for clarifying. I had indeed missed that this discussion was centered around native-tls.

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

3 participants