stompgem / stomp

A ruby gem for sending and receiving messages from a Stomp protocol compliant message queue. Includes: failover logic, ssl support.
http://stomp.github.com
Apache License 2.0
152 stars 80 forks source link

OpenSSL Deprecations #155

Closed gmallard closed 5 years ago

gmallard commented 5 years ago

The more recent Ruby documentation for OpenSSL::SSL::SSLContext says:

The cert, key, and extra_chain_cert attributes are deprecated. It is recommended to use add_certificate instead.

Review the gem's SSL support with the idea of addressing these deprecations.

gmallard commented 5 years ago

Just a couple of notes for now.

The add_certificate method has been added recently. Not sure exactly when, It is in Ruby 2.5.1, but not Ruby 2.3.2.

The gem attempts to support very old Ruby versions, back to and including 1.8.7. There is no intent to change that.

One strategy might be to use a construct like:

    if ctx.respond_to?(:add_certificate)
        # New code here
    else
        # Old code here
    end

This will result in even more ugly code in netio.rb, but is likely the best implementation route.

gmallard commented 5 years ago

OK, done. See: cd19c71