# File examples/ssl_ctxoptions.rb, line 63
  def run2
    puts "run2 method ...."
    #
    # Connection / Example 2 of 2, gem supplied options.
    #

    urc = defined?(RUBY_ENGINE) && RUBY_ENGINE =~ /jruby/ ? true : false

    # Use gem method to define SSL options.  Exactly the same as the
    # options used in Example 1 above.
    ssl_opts = Stomp::SSLParams.new(:ssl_ctxopts => Stomp::Connection::ssl_v2xoptions(),
       :use_ruby_ciphers => urc,
       :fsck => true)
    sport = ENV["STOMP_PORT"].to_i
    hash = { :hosts => [
        {:login => 'guest', :passcode => 'guest', :host => 'localhost', :port => sport, :ssl => ssl_opts},
      ],
      :reliable => false, # YMMV, to test this in a sane manner
    }
    #
    puts "Connect starts, SSLContext Options Set: #{Stomp::Connection::ssl_v2xoptions()}"
    c = Stomp::Connection.new(hash)
    puts "Connect completed"
    puts "SSL Verify Result: #{ssl_opts.verify_result}"
    # puts "SSL Peer Certificate:\n#{ssl_opts.peer_cert}"
    #
    c.disconnect
  end