Class: Stomp::SSLParams

### Home Classes Methods

### In Files

- lib/stomp/sslparams.rb

### Parent

Object

### Methods

- ::new

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

# Stomp::SSLParams

## Purpose

Parameters for STOMP ssl connections.

### Attributes

cert_file[RW]

The client certificate file.

ciphers[RW]

Optional list of SSL ciphers to be used. In the format documented for Ruby's OpenSSL.

ctx[RW]

Back reference to the OpenSSL::SSL::SSLContext instance, gem sets before connect.

fsck[R]

Client wants file existance check on initialize. true/value or false/nil.

key_file[RW]

The client private key file.

key_password[RW]

The client private key password.

peer_cert[RW]

The certificate of the connection peer (the server), received during the handshake.

ts_files[RW]

The trust store files. Normally the certificate of the CA that signed the server's certificate. One file name, or a CSV list of file names.

use_ruby_ciphers[R]

Absolute command to use Ruby default ciphers.

verify_result[RW]

SSL Connect Verify Result. The result of the handshake.

### Public Class Methods

new(opts={}) click to toggle source

initialize returns a valid instance of SSLParams or raises an error.

    # File lib/stomp/sslparams.rb, line 44
    def initialize(opts={})

     # Server authentication parameters
     @ts_files = opts[:ts_files]   # A trust store file, normally a CA's cert
     # or a CSV list of cert file names

     # Client authentication parameters
     @cert_file = opts[:cert_file]         # Client cert
     @key_file = opts[:key_file]           # Client key
     @key_password = opts[:key_password]           # Client key password
     #
     raise Stomp::Error::SSLClientParamsError if @cert_file.nil? && !@key_file.nil?
     raise Stomp::Error::SSLClientParamsError if !@cert_file.nil? && @key_file.nil?
     #
     @ciphers = opts[:ciphers]
     @use_ruby_ciphers = opts[:use_ruby_ciphers] ? opts[:use_ruby_ciphers] : false
     #
     if opts[:fsck]
      if @cert_file
       raise Stomp::Error::SSLNoCertFileError if !File::exists?(@cert_file)
       raise Stomp::Error::SSLUnreadableCertFileError if !File::readable?(@cert_file)
      end
      if @key_file
       raise Stomp::Error::SSLNoKeyFileError if !File::exists?(@key_file)
       raise Stomp::Error::SSLUnreadableKeyFileError if !File::readable?(@key_file)
      end
      if @ts_files
       tsa = @ts_files.split(",")
       tsa.each do |fn|
        raise Stomp::Error::SSLNoTruststoreFileError if !File::exists?(fn)
        raise Stomp::Error::SSLUnreadableTruststoreFileError if !File::readable?(fn)
       end
      end
     end
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.