Open tegefaulkes opened 1 year ago
This applies to both ECDSA and Ed25519.
The following is a test case for how state transitions for the quiche connection:
ECDSA success
✓ client connect
✓ client dialing
✓ client and server negotiation (1 ms)
✓ server accept
✓ client <-initial- server (1 ms)
✓ client is established
✓ client -initial-> server (1 ms)
✓ server is established
✓ client <-short- server
✓ client -short-> server (1 ms)
✓ client and server established
✓ client close (23 ms)
ECDSA fail verifying client
✓ client connect
✓ client dialing
✓ client and server negotiation (2 ms)
✓ server accept
✓ client <-initial- server
✓ client is established
✓ client -initial-> server (2 ms)
✓ client <-handshake- server (2 ms)
✓ client and server close (14 ms)
ECDSA fail verifying server
✓ client connect
✓ client dialing
✓ client and server negotiation (2 ms)
✓ server accept
✓ client <-initial- server (2 ms)
✓ client -initial-> server (3 ms)
✓ client and server close (2995 ms)
Ed25519 success
✓ client connect
✓ client dialing
✓ client and server negotiation (1 ms)
✓ server accept (1 ms)
✓ client <-initial- server
✓ client is established (1 ms)
✓ client -initial-> server
✓ server is established
✓ client <-short- server (1 ms)
✓ client -short-> server
✓ client and server established (1 ms)
✓ client close (23 ms)
Ed25519 fail verifying client
✓ client connect (1 ms)
✓ client dialing
✓ client and server negotiation (1 ms)
✓ server accept (1 ms)
✓ client <-initial- server
✓ client is established
✓ client -initial-> server (2 ms)
✓ client <-handshake- server (2 ms)
✓ client and server close (13 ms)
Ed25519 fail verifying server
✓ client connect
✓ client dialing
✓ client and server negotiation (2 ms)
✓ server accept
✓ client <-initial- server (2 ms)
✓ client -initial-> server (2 ms)
✓ client and server close (2997 ms)
We can see that at the end for when client fails verifying the server, the server connection's timeout is about 3 seconds. This does not happen for RSA though.
I'm running some tests to make sure that when a connection fails during a handshake to see if everything is handled as expected and the connection is cleaned up. What I'm expecting is when the handshake fails, a close frame is sent, both sides enter a draining state and then close and i'm expecting this all to happen relatively quickly.
This is working as expected in most cases. Except for one edge case. When the server provides a self signed
ed25519
certificate and the client rejects this with aTlsFail
error due to it being self signed. The client sends a close frame as expected and enters the draining state. The server processes this and enters the draining state as expected. But It waits for about 3 seconds for thetimeout()
andon_timeout()
handling before entering the closed state. The client connection enters the closed state very quickly.In contrast, with the same test but using a
RSA
signed certificate, The same process happens but the server connection doesn't wait the 3 seconds theed25519
example does.For reference, here are the packets that are sent over the network.
So I have a few questions.
quiche
? Specifically when using aed25519
certificate?I can provide some logging of the internal logic but it's not very clean. Right now I just need more context of what is expected to happen.