Skip to content

Add the #starttls method for TCP sockets#79

Merged
jheysel-r7 merged 4 commits intorapid7:masterfrom
zeroSteiner:feat/tcp/starttls
Dec 2, 2025
Merged

Add the #starttls method for TCP sockets#79
jheysel-r7 merged 4 commits intorapid7:masterfrom
zeroSteiner:feat/tcp/starttls

Conversation

@zeroSteiner
Copy link
Contributor

This PR makes 3 changes, one in each commit, the most important of which adds the ability to initialize an SSL/TLS session with the peer when using a TCP socket on demand. This is particularly useful for protocols that implement SSL/TLS negotiation after some sort of exchange, e.g. SMTP, PostgreSQL, MSSQL, LDAP. With this method, the caller of the socket can implement the necessary protocol-specific exchange, then switch the socket to SSL/TLS on demand.

Extra changes include

  • Extending socket pairs with the appropriate Rex::Socket class, which is needed so a TCP socket pair will have the new #starttls method
  • Dropped old patches for Ruby versions older than 1.9.2 since they're no longer necessary (Metasploit uses 3.2+ these days).

Testing

There will be a Framework PR that'll require this and use the changes that can be used for testing. It'll be linked once it's open.

@jheysel-r7 jheysel-r7 merged commit 7606a12 into rapid7:master Dec 2, 2025
20 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.

2 participants