Skip to content

Instantly share code, notes, and snippets.

@lusis
Forked from jgyllen/gist:839690
Created February 2, 2012 19:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lusis/1725181 to your computer and use it in GitHub Desktop.
Save lusis/1725181 to your computer and use it in GitHub Desktop.
RabbitMQ+SSL with Ruby
# rabbitmq.config
[
{rabbit, [
{tcp_listeners,[{"127.0.0.1",5672}]},
{ssl_listeners, [{"127.0.0.1",5671}]},
{ssl_options, [{cacertfile,"/usr/local/etc/rabbitmq/ssl/testca/cacert.pem"},
{certfile,"/usr/local/etc/rabbitmq/ssl/server/cert.pem"},
{keyfile,"/usr/local/etc/rabbitmq/ssl/server/key.pem"},
{verify,verify_none},
{fail_if_no_peer_cert,false}]}
]}
].
# Ruby code with ruby-amqp
AMQP.start('amqps://wilco.local/') do
channel = AMQP::Channel.new
p channel.queues
AMQP.stop {EM.stop}
end
# Ruby code with bunny
b = Bunny.new(:host => 'wilco.local', :ssl => true)
b.start
p b.status
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment