Sha256: d1a91cb6038a2058f2e9c66e8ccc2abbd7089a0f80e4f8d0ccb52bd4633708e8

Contents?: true

Size: 749 Bytes

Versions: 2

Compression:

Stored size: 749 Bytes

Contents

#
# Reference: https://github.com/morellon/stomp/wiki/extended-ssl-overview
#
require "rubygems"
require "stomp"
#
# SSL Use Case 3
#
ts_flist = []
ts_flist << "/home/gmallard/sslwork/twocas_tj/serverCA/ServerTJCA.crt"
ssl_opts = Stomp::SSLParams.new(:ts_files => ts_flist.join(","))
#
hash = { :hosts => [ 
      {:login => 'guest', :passcode => 'guest', :host => 'localhost', :port => 61612, :ssl => ssl_opts},
      ]
    }
#
puts "Connect starts, SSL Use Case 3"
c = Stomp::Connection.new(hash)
puts "Connect completed"
#
# Expect a verify_result == 0
#
# This means: the client successfully verified the peer's certificate.
#
puts "SSL Verify Result: #{ssl_opts.verify_result}"
puts "SSL Peer Certificate:\n#{ssl_opts.peer_cert}"
c.disconnect

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
stomp-1.2.2 examples/ssl_uc3.rb
stomp-1.2.1 examples/ssl_uc3.rb