Issue #20458 has been updated by postmodern (Hal Brodigan).
Ah I see the problem now. `OpenSSL::SSL::SSLContext#ssl_version` accepts `:TLSv1*`
symbols, but `#min_version` and `#max_version` only seem to accept `:TLS1*` symbols
without the `v`. This seems inconsistent and prone to causing confusion.
----------------------------------------
Bug #20458: OpensSSL::SSL::SSLContext#min_version= and #max_version no longer accept
Symbol values
https://bugs.ruby-lang.org/issues/20458#change-108123
* Author: postmodern (Hal Brodigan)
* Status: Open
* ruby -v: ruby 3.3.1 (2024-04-23 revision c56cd86388) [x86_64-linux]
* Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN
----------------------------------------
It appears that `OpenSSL::SSL::SSLContext#min_version=` and `#max_version=` no longer
accept Symbol values, contrary to their
[
documentation](https://docs.ruby-lang.org/en/master/OpenSSL/SSL/SSLContext.….
Instead it appears they are being converted to Strings.
## Steps To Reproduce
```ruby
require 'openssl'
context = OpenSSL::SSL::SSLContext.new
context.min_version = :TLSv1
```
```ruby
require 'openssl'
context = OpenSSL::SSL::SSLContext.new
context.max_version = :TLSv1_2
```
### Expected Results
Sets `min_version` and `max_version` to the according `OpenSSL::SSL::TLS1_VERSION` and
`OpenSSL::SSL::TLS1_2_VERSION` values, respectively.
### Actual Results
```
/usr/share/ruby/openssl/ssl.rb:179:in `set_minmax_proto_version': unrecognized version
"TLSv1" (ArgumentError)
set_minmax_proto_version(version, @max_proto_version ||= nil)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
from /usr/share/ruby/openssl/ssl.rb:179:in `min_version='
```
```
/usr/share/ruby/openssl/ssl.rb:191:in `set_minmax_proto_version': unrecognized version
"TLSv1_2" (ArgumentError)
set_minmax_proto_version(@min_proto_version ||= nil, version)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
from /usr/share/ruby/openssl/ssl.rb:191:in `max_version='
```
### Version Info
Tested on:
* `ruby 3.2.2 (2023-03-30 revision e51014f9c0) [x86_64-linux]` and `openssl` gem version
`3.1.0`
* `ruby 3.3.1 (2024-04-23 revision c56cd86388) [x86_64-linux]` and `openssl` gem version
`3.2.0`
--
https://bugs.ruby-lang.org/