Closed zdave-parity closed 4 months ago
Thanks for the report! I agree with your analysis. The spec has guidance that we should implement:
Prior to confirming the handshake, a peer might be unable to process 1-RTT packets, so an endpoint SHOULD send a CONNECTION_CLOSE frame in both Handshake and 1-RTT packets. A server SHOULD also send a CONNECTION_CLOSE frame in an Initial packet.
Fix drafted at https://github.com/quinn-rs/quinn/pull/1767.
You can see this if you edit the
connection
example to simply drop the incoming connection before completing the handshake:The server sends a
CONNECTION_CLOSE
frame, but the client doesn't appear to recognise it:I believe what's happening is something like:
highest_space
gets set toData
as from the server's perspective the handshake is complete.poll_transmit
is called. This notices that the connection has been closed, and explicitly ignores all data in spaces other thanhighest_space
(https://docs.rs/quinn-proto/0.10.6/src/quinn_proto/connection/mod.rs.html#526). This presumably includes the server hello and handshake, without which the client can't decrypt anything in the data space! It then writes out aCONNECTION_CLOSE
frame inhighest_space
(Data
).