mirror of
https://github.com/apple/swift-nio-ssl
synced 2026-11-24 04:38:08 +00:00
## Motivation Follow up #603 by making its fatal input-closure path safe against synchronous downstream reentrancy. While an additional certificate verification future is pending, `userInboundInputClosedTriggered` forwards `ChannelEvent.inputClosed` before `channelClose` changes the handler state. A downstream handler can synchronously complete that future from the callback, re-enter the handshake while the state still says `.additionalVerification`, and attempt to reactivate a connection whose input has already closed. ## Modifications - Mark fatal handshake input closure as `.closed` before firing downstream error and input-closed events. - Strengthen the existing additional-verification regression so a downstream input-closed handler completes the verification future synchronously. - Preserve the post-handshake ragged-EOF and remote-half-closure behavior from #603. ## Testing `swift test --filter NIOSSLIntegrationTest.testInputClosedDuringAdditionalVerificationClosesTheChannel` Result: 1 test passed. The commit is signed and based directly on the merge commit for #603 (`03827c1a9fdb2b6b00a4e93ede8861520263af8c`). Co-authored-by: Cory Benfield <lukasa@apple.com>