Sha256: f31e5885e5f3134c4dbfdd7abfc64d2d289099bcb825406cd448842deea34418

Contents?: true

Size: 1.85 KB

Versions: 11

Compression:

Stored size: 1.85 KB

Contents

# -*- encoding: utf-8 -*-

#
# Reference: https://github.com/stompgem/stomp/wiki/extended-ssl-overview
#
require "rubygems"
require "stomp"
#
# == SSL Use Case 1 - User Supplied Ciphers
#
# If you need your own ciphers list, this is how.
# Stomp's default list will work in many cases.  If you need to use this, you
# will know it because SSL connect will fail.  In that case, determining
# _what_ should be in the list is your responsibility.
#
class ExampleSSL1C
  # Initialize.
  def initialize
  end
  # Run example.
  def run
    ciphers_list = [["DHE-RSA-AES256-SHA", "TLSv1/SSLv3", 256, 256], ["DHE-DSS-AES256-SHA", "TLSv1/SSLv3", 256, 256], ["AES256-SHA", "TLSv1/SSLv3", 256, 256], ["EDH-RSA-DES-CBC3-SHA", "TLSv1/SSLv3", 168, 168], ["EDH-DSS-DES-CBC3-SHA", "TLSv1/SSLv3", 168, 168], ["DES-CBC3-SHA", "TLSv1/SSLv3", 168, 168], ["DHE-RSA-AES128-SHA", "TLSv1/SSLv3", 128, 128], ["DHE-DSS-AES128-SHA", "TLSv1/SSLv3", 128, 128], ["AES128-SHA", "TLSv1/SSLv3", 128, 128], ["RC4-SHA", "TLSv1/SSLv3", 128, 128], ["RC4-MD5", "TLSv1/SSLv3", 128, 128], ["EDH-RSA-DES-CBC-SHA", "TLSv1/SSLv3", 56, 56], ["EDH-DSS-DES-CBC-SHA", "TLSv1/SSLv3", 56, 56],
    ["DES-CBC-SHA", "TLSv1/SSLv3", 56, 56], ["EXP-EDH-RSA-DES-CBC-SHA", "TLSv1/SSLv3", 40, 56], ["EXP-EDH-DSS-DES-CBC-SHA", "TLSv1/SSLv3", 40, 56], ["EXP-DES-CBC-SHA", "TLSv1/SSLv3", 40, 56], ["EXP-RC2-CBC-MD5", "TLSv1/SSLv3", 40, 128], ["EXP-RC4-MD5", "TLSv1/SSLv3", 40, 128]]

    ssl_opts = Stomp::SSLParams.new(:ciphers => ciphers_list)

    #
    # SSL Use Case 1
    #
    hash = { :hosts => [
        {:login => 'guest', :passcode => 'guest', :host => 'localhost', :port => 61612, :ssl => ssl_opts},
      ]
    }
    #
    puts "Connect starts, SSL Use Case 1"
    c = Stomp::Connection.new(hash)
    puts "Connect completed"
    puts "SSL Verify Result: #{ssl_opts.verify_result}"
    #
    c.disconnect
  end
end
#
e = ExampleSSL1C.new
e.run

Version data entries

11 entries across 9 versions & 2 rubygems

Version Path
torquebox-console-0.3.0 vendor/bundle/jruby/1.9/gems/stomp-1.2.8/examples/ssl_uc1_ciphers.rb
torquebox-console-0.2.5 vendor/bundle/ruby/1.8/gems/stomp-1.2.8/examples/ssl_uc1_ciphers.rb
torquebox-console-0.2.5 vendor/bundle/jruby/1.9/gems/stomp-1.2.8/examples/ssl_uc1_ciphers.rb
stomp-1.2.9 examples/ssl_uc1_ciphers.rb
torquebox-console-0.2.4 vendor/bundle/jruby/1.9/gems/stomp-1.2.8/examples/ssl_uc1_ciphers.rb
torquebox-console-0.2.4 vendor/bundle/ruby/1.8/gems/stomp-1.2.8/examples/ssl_uc1_ciphers.rb
torquebox-console-0.2.3 vendor/bundle/jruby/1.9/gems/stomp-1.2.8/examples/ssl_uc1_ciphers.rb
stomp-1.2.8 examples/ssl_uc1_ciphers.rb
stomp-1.2.7 examples/ssl_uc1_ciphers.rb
stomp-1.2.6 examples/ssl_uc1_ciphers.rb
stomp-1.2.5 examples/ssl_uc1_ciphers.rb