Skip to content

Conversation

wanlebing
Copy link

Post-handshake messages have no opportunity to be sent actually. Add a flag to allow these messages to be sent during the handshake phase.

@maddeleine maddeleine requested review from maddeleine and removed request for WesleyRosenblum September 18, 2025 17:33
@maddeleine
Copy link
Contributor

Hi @wanlebing, sorry for the wait on the PR review. Could you provide more context on what this change is for? My guess is that this is about allowing rustls to send session tickets after the handshake?

@wanlebing
Copy link
Author

wanlebing commented Sep 29, 2025

Hi @wanlebing, sorry for the wait on the PR review. Could you provide more context on what this change is for? My guess is that this is about allowing rustls to send session tickets after the handshake?

sorry for the late reply.

yes, once the server finishes the handshake, poll_complete_handshake() is done immediately. actually, there's no way to wait for rustls to send post-handshake messages like session tickets now.

so a flag is added to wait for rustls to send session tickets via write_hs(), but it's not ideal, all post-handshake messages should be waited, and I'm not sure if there's a better way to handle this.

thanks.

@maddeleine
Copy link
Contributor

Yeah this is tricky. The reason why the tests are failing(aside from some CI failures that are now resolved) is that with this change you're delaying completing the handshake until you've received a session ticket. But technically the session ticket is a post-handshake message, so our tests where we assert the handshake is complete at a specific moment now have to wait until the session ticket arrives. You can see our rustls tests failing here.
Minimally we would need our CI to pass to accept this change. But we would also need a test to assert that resumption is occurring as well. Additionally, when we added resumption for s2n-tls, we had to add two new Session functions for post-handshake operations, I would guess that it would be necessary to implement them for rustls as well. See process_post_handshake_message and should_discard_session.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants