Skip to content
gmallard edited this page Mar 4, 2012 · 5 revisions

1.1.# and 1.2.0 Operation

The ability to use SSL connections was added to the gem in version 1.1.3, and has essentially remained unchanged since that time.

Connection Overview

SSL connections may be requested by either:

  • Stomp::Client users
  • Stomp::Connection users

A request for an SSL connection is indicated by either:

  • Using hashed style parameters, with a hash parameter of :ssl => true
  • Using a URL style parameter requesting SSL: stomp+ssl://sslhost:port

Hashed Parameter Example

hash = { :hosts => [ 
    {:login => 'guest', :passcode => 'guest', :host => 'tjjackson', :port => 62614, :ssl => true},
    ]
}
c = Stomp::Connection.new(hash)

URL Style Parameter Example

url = "failover://(stomp+ssl://login1:passcode1@localhost:61616,stomp+ssl://login2:passcode2@remotehost:61617)"
c = Stomp::Client.new(url)

Technical Operation

When this style of SSL connection is requested, the following occurs:

  • An OpenSSL context object is created.
  • The SSL verify mode in the context is set to VERIFY_NONE.
  • An SSLSocket is created using the context. The SSL handshake occurs during this process.

This behavior will not change as a result of the enhancements being added.

Use Case Note

Note that this methodology implements Use Case 1, as described in: SSL Use Cases.

Clone this wiki locally