Parent

Methods

Class/Module Index [+]

Quicksearch

ExampleSSL4

SSL Use Case 4 - server does authenticate client, client does authenticate server

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

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

Public Class Methods

new() click to toggle source

Initialize.

# File examples/ssl_uc4.rb, line 24
def initialize
end

Public Instance Methods

run() click to toggle source

Run example.

# File examples/ssl_uc4.rb, line 27
def run
  # Change the following:
  # * location of the client's private key
  # * location of the client's signed certificate
  # * location of the server's CA signed certificate
  ssl_opts = Stomp::SSLParams.new(
    :key_file => "/home/gmallard/sslwork/2013/client.key", # The client's private key
    :cert_file => "/home/gmallard/sslwork/2013/client.crt", # The client's signed certificate
    :ts_files => "/home/gmallard/sslwork/2013/TestCA.crt", # The CA's signed sertificate
    :fsck => true # Check that files exist first
  )
  #
  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 4"
  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.