Skip to content

Conversation

@einarmo
Copy link
Contributor

@einarmo einarmo commented Nov 18, 2025

Issue #175 is likely caused by a race condition, which happens because we don't update the secure channel until we've received the response over the oneshot channel from the transport.

This fixes that by giving the transport access to the secure channel state directly, and calling end_issue_or_renew_secure_channel there instead of as part of sending the request.

Nothing else has really changed, we still hold a lock while renewing the channel, this just makes it so that there is no way we can receive any more chunks before the secure channel has been updated.

I noticed when doing this that we hold a write lock on the secure channel which we almost never need. I'd like us to fix that, at some point.

Confirmed: this fixes #175.

Issue #175 is likely caused by a race condition, which happens because
we don't update the secure channel until we've received the response
over the oneshot channel from the transport.

This fixes that by giving the transport access to the secure channel
state directly, and calling `end_issue_or_renew_secure_channel` there
instead of as part of sending the request.

Nothing else has really changed, we still hold a lock while renewing the
channel, this just makes it so that there is no way we can receive any
more chunks before the secure channel has been updated.

I noticed when doing this that we hold a write lock on the secure
channel which we almost never need. I'd like us to fix that, at some
point.
@svanharmelen
Copy link
Contributor

I have time for the open PR's today, so will review and update them this afternoon!

@einarmo einarmo merged commit 3b418a7 into master Dec 3, 2025
6 checks passed
@einarmo einarmo deleted the fix-channel-update branch December 3, 2025 09:01
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.

BadSecureChannelClosed: Missing decryption keys

3 participants