def run1
require 'openssl' unless defined?(OpenSSL)
puts "run method ...."
opts = OpenSSL::SSL::OP_ALL
opts &= ~OpenSSL::SSL::OP_DONT_INSERT_EMPTY_FRAGMENTS if defined?(OpenSSL::SSL::OP_DONT_INSERT_EMPTY_FRAGMENTS)
opts |= OpenSSL::SSL::OP_NO_COMPRESSION if defined?(OpenSSL::SSL::OP_NO_COMPRESSION)
opts |= OpenSSL::SSL::OP_NO_SSLv2 if defined?(OpenSSL::SSL::OP_NO_SSLv2)
opts |= OpenSSL::SSL::OP_NO_SSLv3 if defined?(OpenSSL::SSL::OP_NO_SSLv3)
urc = defined?(RUBY_ENGINE) && RUBY_ENGINE =~ /jruby/ ? true : false
ssl_opts = Stomp::SSLParams.new(:ssl_ctxopts => opts,
: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,
}
puts "Connect starts, SSLContext Options Set: #{opts}"
c = Stomp::Connection.new(hash)
puts "Connect completed"
puts "SSL Verify Result: #{ssl_opts.verify_result}"
c.disconnect
end