eclipse-paho / eclipse-paho/paho.mqtt.java

MQTT5 Client unable to send AUTH requests to establish a connection

Open
#981 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
2.3k
Forks
919
PR merge metrics
No merged PRs in 30d

Description

Please fill out the form below before submitting, thank you!

- [Y] Bug exists Release Version 1.2.5 ( Master Branch)
- [N] Bug exists in MQTTv3 Client on Snapshot Version 1.2.6-SNAPSHOT (Develop Branch)
- [Y] Bug exists in MQTTv5 Client on Snapshot Version 1.2.6-SNAPSHOT (Develop Branch)

During client connection establishment the only message allowed from the client is the CONNECT request. With MQTT 5 the AUTH message is also allowed to be sent. In fact it must be sent to finish authorizing the connection being established.

The fix ( see patch attached ) is to check that the message is either a CONNECT or an AUTH message and then allow the client to send it.

I also attach a simple test to highlight the client interaction during the connection authentication, this will require a broker that supports SASL to test

[SaslExampleTest.zip](https://github.com/eclipse/paho.mqtt.java/files/10387246/SaslExampleTest.zip)

[auth.patch](https://github.com/eclipse/paho.mqtt.java/files/10387224/auth.patch)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.