Fix broken ssl server support on windows - #88
Merged
adfoster-r7 merged 1 commit intoJul 23, 2026
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Fixes Windows SSL TCP server accept retry logic by selecting on the in-progress OpenSSL::SSL::SSLSocket instead of an invalid self.sslsock reference, and adds regression specs to cover TLS accept behavior.
Changes:
- Fix
SslTcpServer#acceptnon-blocking retry path to callIO.selectonssl(the SSLSocket being accepted) rather thanself.sslsock. - Add RSpec coverage for successful TLS accept, sequential accepts, non-blocking accept regression, and aborted-handshake behavior.
Impact Analysis:
- Blast radius: medium; affects all consumers of
Rex::Socket::SslTcpServer#accept(e.g., reverse HTTPS handlers / stream servers) across platforms, with primary benefit on Windows. - Data and contract effects: no schema/payload changes; behavioral change is limited to readiness waiting during non-blocking TLS handshake.
- Rollback and test focus: rollback is straightforward (single-method change); validate Windows reverse-HTTPS handlers and run the added specs, focusing on non-blocking accept retry paths and handshake-failure handling.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| lib/rex/socket/ssl_tcp_server.rb | Fixes non-blocking TLS accept retry logic to select on the correct socket object. |
| spec/rex/socket/ssl_tcp_server_spec.rb | Adds regression and behavior tests for SSL TCP server accept/handshake flows. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
adfoster-r7
force-pushed
the
fix-broken-ssl-server-support-on-windows
branch
from
July 23, 2026 01:38
821d86f to
2a08404
Compare
cgranleese-r7
approved these changes
Jul 23, 2026
This was referenced Jul 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes a bug introduced by 04b35d4
Before 🔴
On windows the reverse https c2 malleable payload supports in 6.5 consistently failed:
After 🍏
no stack trace, and shells: