Parent

Methods

Class/Module Index [+]

Quicksearch

ExampleSSL2

SSL Use Case 2 - server does not authenticate client, client does authenticate server

Subcase 2.A - Message broker configuration does not require client authentication

Subcase 2.B - Message broker configuration does require client authentication

Public Class Methods

new() click to toggle source

Initialize.

# File examples/ssl_uc2.rb, line 22
def initialize
end

Public Instance Methods

run() click to toggle source

Run example.

# File examples/ssl_uc2.rb, line 25
def run
  ts_flist = []

  # Change the following to the location of the server's CA signed certificate.
  ts_flist << "/home/gmallard/sslwork/2013/TestCA.crt"

  ssl_opts = Stomp::SSLParams.new(:ts_files => ts_flist.join(","), 
    :fsck => true,
  )
  #
  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 2"
  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

[Validate]

Generated with the Darkfish Rdoc Generator 2.