Sha256: cc8bb92d5aca857d7ad96e18a3ad7edb20f1feeff8eff9f344b7d283f0d1101f
Contents?: true
Size: 1.22 KB
Versions: 24
Compression:
Stored size: 1.22 KB
Contents
# -*- encoding: utf-8 -*- # # Reference: https://github.com/stompgem/stomp/wiki/extended-ssl-overview # require "rubygems" require "stomp" # # == SSL Use Case 1 - server does *not* authenticate client, client does *not* authenticate server # # Subcase 1.A - Message broker configuration does *not* require client authentication # # - Expect connection success # - Expect a verify result of 20 becuase the client did not authenticate the # server's certificate. # # Subcase 1.B - Message broker configuration *does* require client authentication # # - Expect connection failure (broker must be sent a valid client certificate) # class ExampleSSL1 # Initialize. def initialize end # Run example. def run ssl_opts = Stomp::SSLParams.new hash = { :hosts => [ {:login => 'guest', :passcode => 'guest', :host => 'localhost', :port => 61612, :ssl => ssl_opts}, ], :reliable => false, # YMMV, to test this in a sane manner } # puts "Connect starts, SSL Use Case 1" 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 end # e = ExampleSSL1.new e.run
Version data entries
24 entries across 22 versions & 2 rubygems