halfgaar / FlashMQ

FlashMQ is a fast light-weight MQTT broker/server, designed to take good advantage of multi-CPU environments
https://www.flashmq.org/
Open Software License 3.0
173 stars 24 forks source link

Deal with empty user names some way #91

Closed halfgaar closed 2 months ago

halfgaar commented 3 months ago

FlashMQ currently doesn't except MQTT connect packets that flag a username as present, but is empty. It says:

Username flagged as present, but it's 0 bytes.

The MQTT spec says:

If the User Name Flag is set to 1, a user name MUST be present in the payload

But, there is some ambiguity if a zero byte username means 'present'. FlashMQ has the current behavior to not have two ways of having an anonymous login.

But, because other servers do accept this situation, we should deal with it. Perhaps with a config option.

halfgaar commented 2 months ago

Fixed with the new option zero_byte_username_is_anonymous in the new release.

https://www.flashmq.org/2024/03/29/flashmq-1-11-0-released/