ronin-rb / ronin-support

A support library for Ronin. Like activesupport, but for hacking!
https://ronin-rb.dev
GNU Lesser General Public License v3.0
27 stars 10 forks source link

Fix bug in `Network::HTTP#initialize` with `ssl: {min_version: 1.1}` and `ssl: {max_version: 1.1}` #497

Closed postmodern closed 7 months ago

postmodern commented 7 months ago

It does not look like Float values for min_version and max_version are properly mapped in Network::HTTP#initialize_ssl.

Support::Network::HTTP.get('https://github.com/', ssl: {min_version: 1.1})
/usr/share/ruby/openssl/ssl.rb:179:in `set_minmax_proto_version': no implicit conversion of Float into String (TypeError)

        set_minmax_proto_version(version, @max_proto_version ||= nil)
                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    from /usr/share/ruby/openssl/ssl.rb:179:in `min_version='
    from /usr/share/ruby/openssl/ssl.rb:149:in `block in set_params'
    from /usr/share/ruby/openssl/ssl.rb:149:in `each'
    from /usr/share/ruby/openssl/ssl.rb:149:in `set_params'
    from /usr/share/ruby/net/http.rb:1307:in `connect'
    from /usr/share/ruby/net/http.rb:1248:in `do_start'
    from /usr/share/ruby/net/http.rb:1237:in `start'
    from /usr/share/ruby/net/http.rb:1817:in `request'
    from /usr/local/share/gems/gems/ronin-support-1.0.3/lib/ronin/support/network/http.rb:736:in `request'
postmodern commented 7 months ago

Fixed in 5fb57b5.