mqttclient icon indicating copy to clipboard operation
mqttclient copied to clipboard

connect() does not authenticate

Open jarkko-hautakorpi opened this issue 6 years ago • 0 comments

Using the example provided: $r = new \mqttclient\src\swoole\MqttClient('127.0.0.1', 1883, 10017); $r->setAuth('username','password'); ... $r->connect();

The 'username' and 'password' are never sent to the MQTT server. With using Wireshark, this can be confirmed. Message payload never has 'username' nor 'password' in it.

Mosquitto then reports on connect:

1525541579: New connection from 127.0.0.1 on port 1883. 1525541579: Socket error on client <unknown>, disconnecting.

Connecting with some other client does work when using same username and password. With Wireshark, username and password can be seen in the payload.

How can you authenticate using username and password?

jarkko-hautakorpi avatar May 05 '18 17:05 jarkko-hautakorpi