Sha256: 0891e0d687004431dd9edf58dd0040216cf2b37de69d3d97e547a254b098746f
Contents?: true
Size: 1.47 KB
Versions: 11
Compression:
Stored size: 1.47 KB
Contents
# -*- encoding: utf-8 -*- # # Reference: https://github.com/stompgem/stomp/wiki/extended-ssl-overview # require "rubygems" require "stomp" # # == SSL Use Case 3 - server *does* authenticate client, client does *not* authenticate server # # Subcase 3.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 3.B - Message broker configuration *does* require client authentication # # - Expect connection success if the server can authenticate the client certificate # - Expect a verify result of 20 because the client did not authenticate the # server's certificate. # class ExampleSSL3 # Initialize. def initialize end # Run example. def run ssl_opts = Stomp::SSLParams.new(:key_file => "/home/gmallard/sslwork/twocas_tj/clientCA/ClientTJ.key", :cert_file => "/home/gmallard/sslwork/twocas_tj/clientCA/ClientTJ.crt") # 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 3" 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 = ExampleSSL3.new e.run
Version data entries
11 entries across 9 versions & 2 rubygems