[rabbitmq-discuss] how to detect bad username/password in 0.9.5?

Michael Klishin michael.s.klishin at gmail.com
Mon May 9 16:44:25 BST 2011

On lunedì 9 maggio 2011 at 19.12, Gavin M. Roy wrote:
> In trying to track this down with RabbitMQ 2.4.1 and Pika 0.9.6pre0 I am not seeing any reply back from Rabbit after a Connection.StartOk is sent, the socket just closes.
> Is this expected behavior from the broker perspective? 
Yes. AMQP 0.9.1 spec dictates that before connection is open, any peer that detects connection-level exception must close TCP connection without sending any more data.

> I imagine since the connection is never negotiating doing a Connection.Close from the server is not appropriate. Any suggestions on how to raise this as an Exception since it seems to be an implied behavior that broker disconnects if the mechanism or response values are incorrect?

Several client libraries keep track of whether authentication was started and finished. If TCP connection is closed and
we are in the "still authenticating" state, they raise an exception that hints at possible authentication failure.

amqp gem and Java client work this way and raise PossibleAuthenticationFailureError and PossibleAuthenticationFailureException, respectively.

More information about the rabbitmq-discuss mailing list