ARTEMIS-3764 wrong CONNACK return code for MQTT5
authorJustin Bertram <jbertram@apache.org>
Wed, 6 Apr 2022 16:38:29 +0000 (11:38 -0500)
committerclebertsuconic <clebert.suconic@gmail.com>
Wed, 6 Apr 2022 21:02:19 +0000 (17:02 -0400)
commitb48037a1e683f4e926c0a6a797faf2dcfcd2df3e
tree439c6457c5cf246e9df3da134b40350012308ca5
parent825264257a9e05104e85ea63a81b2486cf3cc370
ARTEMIS-3764 wrong CONNACK return code for MQTT5

This bug is causing tests in o.a.a.a.t.i.m.s.c.ConnectTestsWithSecurity
to fail.

This commit fixes the problem by setting the session's version earlier
in the logic handling the CONNECT packet so that the proper CONNACK
return code can be supplied to the remote client in case of
authentication failure.
artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTConnectionManager.java
artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTProtocolHandler.java