-
Notifications
You must be signed in to change notification settings - Fork 89
Description
I'm not sure that's the correct project to put this issue, please redirect me if need be.
I'm trying to use TLS over Tor, which provides a buffered stream in order to reduce the number of message on the network. The issue is that when handshaking, no flush is called on the stream, but it is excepted to reply to the written TLS header. This isn't an issue when using socket direclty, as every write actually sends it, but it becomes one when wrapping the socket in a BufWriter (or when using a Tor stream).
I was able to trigger it in the tokio-rustls' tests by changing in do_handshake the good stream into a BufWriter::new(Good(server)).
tokio-native-tls is a bit harder to trick as it simply hangs the fetch_google when using .connect("google.com", BufWriter::new(socket)), but not the other tests, dunno why. FYI: I'm running Linux, so openssl is my backend library.
I didn't manage to put a PR together, but I'm happy to try a bit more if given some pointers on the best way to approach it.