Skip to content

ssl: add SSLSocket#min_version= and #max_version= - #1132

Merged
rhenium merged 1 commit into
ruby:masterfrom
kou:ssl-socket-minmax-version
Oct 29, 2026
Merged

rhenium merged 1 commit into
ruby:masterfrom
kou:ssl-socket-minmax-version

Conversation

@kou

@kou kou commented Oct 27, 2026

Copy link
Copy Markdown
Member

Allow setting the supported protocol version range per connection. They are the SSLSocket counterparts of SSLContext#min_version= and #max_version=.

This is a step toward configuring the SSL object directly from callbacks instead of switching the SSLContext.

See also: #1125

Comment thread ext/openssl/ossl_ssl.c Outdated
return arg;
}

/*

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this! The changes look mostly good to me.

As for style, I'd prefer these to be placed next to the SSLContext counterparts, even though that means the declaration order no longer match the order of rb_define_method() calls. I think it's more useful to keep the internal helper (or #ifdef's, for accessors that need them) localized.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It makes sense. I've moved these definitions:

  • ossl_sslctx_set_min_version
  • ossl_ssl_set_min_version
  • ossl_sslctx_set_max_version
  • ossl_ssl_set_max_version

Allow setting the supported protocol version range per connection.
They are the SSLSocket counterparts of SSLContext#min_version= and
#max_version=.

This is a step toward configuring the SSL object directly from
callbacks instead of switching the SSLContext.

See also: ruby#1125

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kou
kou force-pushed the ssl-socket-minmax-version branch from 58bb0cc to 89a15cf Compare October 28, 2026 02:48

@rhenium rhenium left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thanks!

@rhenium
rhenium merged commit 58b1bd8 into ruby:master Oct 29, 2026
47 of 48 checks passed
@kou
kou deleted the ssl-socket-minmax-version branch October 30, 2026 02:25
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