streadway / amqp

Go client for AMQP 0.9.1
http://godoc.org/github.com/streadway/amqp
BSD 2-Clause "Simplified" License
4.88k stars 621 forks source link

AMQPLAIN authentication does not work #514

Open hodbn opened 3 years ago

hodbn commented 3 years ago

Hi,

I've encountered an issue when trying to use AMQPLAIN authentication. It seems that the current implementation does not work out of the box.

I looked for an official reference for the AMQPLAIN authentication but could not find any, but other implementations have different wire formats.

To reproduce, run this gist against a rabbitmq container:

% docker run -d -p 5672:5672 rabbitmq
% go run main.go guest guest amqp://127.0.0.1:5672/
2021/09/09 10:51:38 can't dial: Exception (403) Reason: "username or password not allowed"

I'll add a PR later.