Connecting over SSL #89

prystupa opened this Issue Apr 10, 2012 · 18 comments


None yet

Can this module be used to connect to an AMQP server over SSL? If so, how? I can't seem to find any documentation on this...


If it can, I'd like to see some documentation too or at least a response stating yes or no. I have a fork where I altered the Connection class so I could do AMQP over SSL, but I think things here have progressed to a point where the changes can't be simple merged back in... and I don't have time right now to redo the changes.


Definately... my repo is at I double-check and make sure I have it up to date tonight.


I'd like to connect over SSL as well. Has any progress been made on merging this into the latest codebase?









I try to modify code by replace net. to tls., but because used util.inherite(Connection, net.Stream) - we have error inside util if try inherite from tls.CryptoStream (or tls.CleartextStream)

so... I need offical support ssl\tls for node-amqp


You should not inherit from net.Stream, instead you should refactor to incapsulate the connection.


maybe you have worked implementation?


Unfortunately not. But I worked on similar issues in other protocols/libraries.


Maybe I'll be more descriptive; I'm using Hubot+AMQP to distribute server configurations in a very dynamic cloud configuration; SSL would make it possible for me to skip bringing up and shutting down cross-site VPNs.

I'd definitely love you more than I already do for making this in the first place. If that were even possible.

(or if you could point me in the right direction I'd be glad to take a stab at it)



In addition to an ssl connection, it would be very nice to use the EXTERNAL auth mechanism used for the plugin here:

If no one else wants to start on this, I may look into it, using what esk525 has started with.


Hi all, I'm having some issues with connecting to a RabbitMQ server via SSL. At first, since I don't control the rabbit server, I was attempting to not use any certs. After not being able to connect, I contacted the admin and requested any log entries he might have. I was returned the following:

=INFO REPORT==== 1-Jul-2013::11:17:52 ===
accepting AMQP connection <0.25461.2> ( ->

=ERROR REPORT==== 1-Jul-2013::11:17:53 ===
error on AMQP connection <0.25445.2>: {ssl_upgrade_error,"record overflow"} (unknown POSIX error)

To help troubleshoot, the admin turned on the non-SSL port, and I was able to connect no problem. I have wrote a python script to see if I could connect via SSL that way, and it worked as well. So, I'm certain that the Rabbit server is configured correctly and prepared to accept an SSL connection.

At this point, I requested the SSL certs, and got a .crt file, which is in .pem format. Below you can see the connection string I'm using. All connection variables are passed into the method via an array.

conn = AMQP.createConnection(
host: conn_info['host'],
port: conn_info['host_port'],
login: conn_info['user'],
password: conn_info['pass'],
vhost: conn_info['virt_host'],
ssl: {
enabled: conn_info['ssl_opts']['enabled'],
caFile : '../../certs/ca.crt',
rejectUnauthorized: conn_info['ssl_opts']['rej_unauth']
defaultExchangeName: conn_info['default_exch']

So, I'm positive at this point, the fault lies with me. I'd really appreciate any help I can get!


The only thing I could suggest at this point is to try everything on this page:

I would suggest starting with the section "Validate client connections with stunnel"


@bakkerthehacker You are my hero.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment