Sha256: de8a513ac2b8e0a82b9ea29b0492cd6890fa57ac6687cc2f0b523c46253cd9b3

Contents?: true

Size: 1.38 KB

Versions: 32

Compression:

Stored size: 1.38 KB

Contents

#!/usr/bin/env ruby
# encoding: utf-8

examples_dir = File.join(File.dirname(File.expand_path(__FILE__)), "..", "..")
__dir        = File.join(File.dirname(File.expand_path(__FILE__)), "..")
require File.join(__dir, "example_helper")

certificate_chain_file_path  = File.join(examples_dir, "tls_certificates", "client", "cert.pem")
client_private_key_file_path = File.join(examples_dir, "tls_certificates", "client", "key.pem")

EM.run do
  AMQ::Client::EventMachineClient.connect(:port     => 5671,
                                          :vhost    => "amq_client_testbed",
                                          :user     => "amq_client_gem",
                                          :password => "amq_client_gem_password",
                                          :ssl => {
                                            :cert_chain_file  => certificate_chain_file_path,
                                            :private_key_file => client_private_key_file_path
                                          }) do |client|
    puts "Connected, authenticated. TLS seems to work."

    client.disconnect { puts "Now closing the connection…"; EM.stop }
  end


  show_stopper = Proc.new {
    EM.stop
  }

  Signal.trap "INT",  show_stopper
  Signal.trap "TERM", show_stopper

  # TLS connections take forever and a day
  # (compared to non-TLS connections) to estabilish.
  EM.add_timer(8, show_stopper)
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
amq-client-0.9.0 examples/eventmachine_adapter/tls/tls_without_peer_verification.rb
amq-client-0.9.0.pre2 examples/eventmachine_adapter/tls/tls_without_peer_verification.rb
amq-client-0.9.0.pre1 examples/eventmachine_adapter/tls/tls_without_peer_verification.rb
amq-client-0.8.7 examples/eventmachine_adapter/tls/tls_without_peer_verification.rb
amq-client-0.8.7.pre1 examples/eventmachine_adapter/tls/tls_without_peer_verification.rb
amq-client-0.8.6 examples/eventmachine_adapter/tls/tls_without_peer_verification.rb
amq-client-0.8.5 examples/eventmachine_adapter/tls/tls_without_peer_verification.rb
amq-client-0.8.4 examples/eventmachine_adapter/tls/tls_without_peer_verification.rb
amq-client-0.8.3 examples/eventmachine_adapter/tls/tls_without_peer_verification.rb
amq-client-0.8.2 examples/eventmachine_adapter/tls/tls_without_peer_verification.rb
amq-client-0.8.1 examples/eventmachine_adapter/tls/tls_without_peer_verification.rb
amq-client-0.8.0 examples/eventmachine_adapter/tls/tls_without_peer_verification.rb