cloudflare / quiche

šŸ„§ Savoury implementation of the QUIC transport protocol and HTTP/3
https://docs.quic.tech/quiche/
BSD 2-Clause "Simplified" License
9.12k stars 685 forks source link

Session resumption doesn't work #1803

Open L4stJudgment opened 3 weeks ago

L4stJudgment commented 3 weeks ago

Hi there

I'm trying to use session resumption with 0-RTT using Connection::session() and Connection::set_session() directly after recreating a connection. The client which should save the session with .session() is somehow not able to pull any session-info.

Establishing a connection between server and client with full handshake works according to the logs, the server also sends a stateless retry and the client uses the retry-packet to extract the SCID correctly. But session resumption doesn't work

        if conn.is_established() {
            info!("connection established, {:?}", conn.stats());

            // Save session data after the connection is established
            if let Some(session_data) = conn.session() {
                let data_vec = session_data.to_vec();
                info!("Session data received after connection establishment: {:?}", data_vec);
                return Ok((conn, Some(data_vec)));
            } else {
                error!("No session data received after connection establishment.");
                return Ok((conn, None));
            }
        }

Here is a part of the logs: 2024-06-18T14:54:20.075143700Z [INFO] - connection established, recv=3 sent=2 lost=0 retrans=0 sent_bytes=618 recv_bytes=1503 lost_bytes=0 2024-06-18T14:54:20.075350000Z [ERROR] - No session data received after connection establishment.

L4stJudgment commented 3 weeks ago

@LPardue I've seen you implemented some testing around session resumption. Can you maybe help me out? That would be great, thank you!