rustls / tokio-rustls

Async TLS for the Tokio runtime
Apache License 2.0
126 stars 70 forks source link

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

Closed leptonyu closed 1 month ago

leptonyu commented 1 month ago

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.

djc commented 1 month ago

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.

leptonyu commented 1 month ago

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

djc commented 1 month ago

Suggest you provide a complete minimal reproduction of your issue.

cpu commented 1 month ago

Closing this for now pending a reproducer.