Skip to content

Close SecureTransport native sockets without a TLS context - #657

Merged
bsergean merged 1 commit into
masterfrom
fix/securetransport-socket-close
Nov 17, 2026
Merged

bsergean merged 1 commit into
masterfrom
fix/securetransport-socket-close

Conversation

@bsergean

Copy link
Copy Markdown
Collaborator

Calling SocketAppleSSL::close() before a TLS context existed returned without closing an adopted native descriptor. This could keep the descriptor open until the socket object was destroyed. Always close the native socket after optionally releasing the TLS context, matching the OpenSSL and MbedTLS backends.

The regression test uses an unconnected local descriptor and checks immediate closure with and without a TLS context. It failed on master and passes with the fix; both cases take less than a millisecond and use no sleeps or timeout waits.

Validation: complete SecureTransport suite, 31/31 passed; TLS adapter tests, 28 assertions passed. Production builds as C++11 with warnings treated as errors (legacy SecureTransport deprecation warnings excluded). git clang-format and git diff --check pass.

@bsergean
bsergean merged commit ad7aff1 into master Nov 17, 2026
13 checks passed
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.

1 participant