Class: ExampleSSL3

### Home Classes Methods

### In Files

- examples/ssl_uc3.rb

### Parent

Object

### Methods

- ::new
- #run

### Files

- CHANGELOG.rdoc
- LICENSE

### Class/Module Index

Quicksearch

- Stomp
- Stomp::Client
- Stomp::Connection
- Stomp::Error
- Stomp::Error::ConnectReadTimeout
- Stomp::Error::DuplicateSubscription
- Stomp::Error::InvalidFormat
- Stomp::Error::InvalidHeartBeatHeaderError
- Stomp::Error::InvalidMessageLength
- Stomp::Error::InvalidServerCommand
- Stomp::Error::LoggerConnectionError
- Stomp::Error::MalformedFailoverOptionsError
- Stomp::Error::MaxReconnectAttempts
- Stomp::Error::MessageIDRequiredError
- Stomp::Error::NilMessageError
- Stomp::Error::NoCurrentConnection
- Stomp::Error::PacketParsingTimeout
- Stomp::Error::ProtocolError11p
- Stomp::Error::ProtocolErrorConnect
- Stomp::Error::SSLClientParamsError
- Stomp::Error::SSLNoCertFileError
- Stomp::Error::SSLNoKeyFileError
- Stomp::Error::SSLNoTruststoreFileError
- Stomp::Error::SSLUnreadableCertFileError
- Stomp::Error::SSLUnreadableKeyFileError
- Stomp::Error::SSLUnreadableTruststoreFileError
- Stomp::Error::SocketOpenTimeout
- Stomp::Error::StompServerError
- Stomp::Error::SubscriptionRequiredError
- Stomp::Error::UTF8ValidationError
- Stomp::Error::UnsupportedProtocolError
- Stomp::HeaderCodec
- Stomp::Message
- Stomp::SSLParams
- Client11Example1
- Client11PutGet1
- Connection11Example1
- Connection11Example2
- ExampleConsumer
- ExamplePublisher
- ExampleRubyCiphers
- ExampleSSL1
- ExampleSSL1C
- ExampleSSL2
- ExampleSSL2C
- ExampleSSL3
- ExampleSSL3C
- ExampleSSL4
- ExampleSSL4C
- ExampleTopicConsumer
- ExampleTopicPublisher
- Hash
- HeartBeatExample1
- LoggerExample
- Object
- Publish11Example1
- Receive11Example1
- Receive11Example2
- RepeatedHeadersExample
- SSLLoggerExample
- Slogger
- Stomp11Common
- TestBase
- TestClient
- TestConnection
- TestConnection1P
- TestMessage
- TestSSL
- TestURLLogins
- Tlogger

No matching classes.

# ExampleSSL3

## 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.

### Public Class Methods

new() click to toggle source

Initialize.

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

### Public Instance Methods

run() click to toggle source

Run example.

    # File examples/ssl_uc3.rb, line 27
    def run
      # Change the following:
      # * location of the client's signed certificate
      # * location of the client's private key.
      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
        :fsck => true # Check that the 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 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

[Validate]

Generated with the Darkfish Rdoc Generator 2.