tokio-rustls icon indicating copy to clipboard operation
tokio-rustls copied to clipboard

Is there any buffer in server::TlsStream when reading?

Open leptonyu opened this issue 1 year ago • 3 comments

I found that second packet of a new connection cannot read by server side, but when client send another packet 5secs later, server side can read normally.

leptonyu avatar Oct 02 '24 05:10 leptonyu

Yes, the rustls ServerConnection does contain an internal buffer, and if we've only received a partial TLS record we'll need to wait for the rest of the contents before we're able to decrypt it.

djc avatar Oct 02 '24 08:10 djc

How to enforce write a tls record? In this case, seems we need to let tlsstream generate a complete tls record, not a partial.

leptonyu avatar Oct 02 '24 09:10 leptonyu

Suggest you provide a complete minimal reproduction of your issue.

djc avatar Oct 02 '24 10:10 djc

Closing this for now pending a reproducer.

cpu avatar Oct 17 '24 14:10 cpu