amqp / rhea

A reactive messaging library based on the AMQP protocol
Apache License 2.0
279 stars 79 forks source link

ConnectionError: No suitable mechanism; server supports CRAM-MD5,SCRAM-SHA-1,SCRAM-SHA-256 #159

Open Neaven opened 5 years ago

Neaven commented 5 years ago

Hi I'm getting the above connection error when trying to connect to Qpid (Java version 7.0.6). I am trying out a few brokers (RabbitMQ and ActiveMQ) and both do not have similar issue. Below is how i test the various broker

var container = require('rhea');

container.options.username = "guest"; container.options.password = "guest";

container.on('connection_open', function (context) { console.log('Connected!'); });

container.on('connection_open', function (context) { context.connection.open_receiver('examples'); context.connection.open_sender('examples'); }); container.on('message', function (context) { console.log(context.message.body); //context.connection.close(); });

container.on('receiver_open', function (context) { console.log("Receiver connected to %s:%d", context.connection.options.host, context.connection.options.port); send("Hello World!"); });

container.connect({ 'port': 5672, 'host':'localhost' });

function send(message) { container.on('sendable', function (context) { context.sender.send({ body: message }); }); }

How can i support the mechanism as specified by the connection error?

grs commented 5 years ago

By default, the qpid java broker does not allow PLAIN unless the underlying socket is usig TLS/SSL. This is to protect users from inadvertently sending passwords in the clear.

At present rhea does not support CRAM/SCRAM mechanisms. So the options would be either to use TLS and PLAIN, or to configure the broker to allow PLAIN over not TLS sockets.