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

Passing an incorrect login / password does not result in throwing an exception #18

Closed
michalzielanski opened this issue Sep 10, 2020 · 1 comment

Comments

@michalzielanski
Copy link

michalzielanski commented Sep 10, 2020

When we provide an incorrect login or password, the broker closes the connection (without sending the ConnectionCloseFrame, it just terminates the socket connection) and Ridge does not inform about it in any way. I think an exception should be thrown informing about this fact.

Example:

use Amp\Loop;
use PHPinnacle\Ridge\Client;

Loop::run(function () {
    $client = Client::create('amqp://user:wrongpass@localhost:5672');

    yield $client->connect();

    echo "Execution will never get here. Nor will an exception be thrown.";

    // (...)
});

RabbitMQ logs:

2020-09-10 08:39:02.330 [info] <0.13118.7> accepting AMQP connection <0.13118.7> (192.168.5.23:33952 -> 172.17.0.3:5672)
2020-09-10 08:39:02.332 [error] <0.13118.7> Error on AMQP connection <0.13118.7> (192.168.5.23:33952 -> 172.17.0.3:5672, state: starting):
AMQPLAIN login refused: user 'user' - invalid credentials
2020-09-10 08:39:05.332 [info] <0.13118.7> closing AMQP connection <0.13118.7> (192.168.5.23:33952 -> 172.17.0.3:5672)
@mmasiukevich
Copy link
Contributor

24

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

No branches or pull requests

2 participants