Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connect 'mechanism' is hardcoded to 'PLAIN' #105

Closed
utestmig opened this issue Oct 19, 2014 · 7 comments
Closed

Connect 'mechanism' is hardcoded to 'PLAIN' #105

utestmig opened this issue Oct 19, 2014 · 7 comments

Comments

@utestmig
Copy link

Our rabbit installation isn't configured for 'PLAIN' and IT does not want to use plain. We authenticate via SSL certs. However, the connection code has it hardcoded to 'PLAIN' and there isn't a way to pass in a different mechanism setting type.

@squaremo
Copy link
Collaborator

You're absolutely right, amqplib doesn't make any attempt to support anything other than PLAIN. In part because it complicates the opening handshake, already complicated.

You're after EXTERNAL, is that right?

@michaelklishin
Copy link

IMO EXTERNAL is worth supporting, and several popular clients (.NET, Java, Bunny, I believe Pika, too) support it.

@squaremo
Copy link
Collaborator

@utestmig I've pushed a change to master which adds the ability to give credentials when connecting.

To use it, you do something like this:

var amqp = require('amqplib');
var opts = {
  // ... SSL certificates and so on
  credentials: amqp.credentials.external()
};
var open = amqp.connect("amqps://rabbit:5671", opts);
// ...

(An explanation of the SSL options is given in http://www.squaremobius.net/amqp.node/doc/ssl.html, which you have probably found already)

I have a bit more work to do on it, but would you try it out and let me know if it 1. works properly 2. works in the way you'd expect. Thanks!

@utestmig
Copy link
Author

Thanks!!!
I will try and let you know shortly.

@utestmig
Copy link
Author

@squaremo works!

Thanks again.

@torvitas
Copy link

Could someone hint me to the documentation of this behaviour please?

@anngo23
Copy link

anngo23 commented Jul 6, 2024

10 years later, still adding a ton of value here with this fix. Thanks! 😂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants