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

allow_zero_length_clientid appears to be false when using per_listener_settings #1429

dustin opened this issue Sep 25, 2019 · 1 comment


Copy link

@dustin dustin commented Sep 25, 2019

I have two instances of mosquitto running, and have MQTT v5 clients talking to both. I noticed my client wasn't working on one of my instances when I didn't send a client ID, but did on the other.

Then I noticed the following on the one that was failing:

mosquitto_pub -t tmp/test -m testing

worked, but

mosquitto_pub -t tmp/test -m testing -V 5

failed with Connection error: Unspecified error

It did work when I sent a -i, so I checked the manual and found

allow_zero_length_clientid [ true | false ]
MQTT 3.1.1 and MQTT 5 allow clients to connect with a zero length client id and have the broker generate a client id for them. Use this option to allow/disallow this behaviour. Defaults to true.

I'm also using per_listener_settings on the system that isn't working (it has a TLS listener), so I tried explicitly setting allow_zero_length_clientid true in each section and it started allowing empty client IDs.

ralight added a commit that referenced this issue Sep 26, 2019
Closes #1429. Thanks to Dustin Sallings.

This comment has been minimized.

Copy link

@ralight ralight commented Sep 26, 2019

You're right, thanks. I've written a big test that goes through a lot of variations of this and have fixed a few places where it wasn't behaving properly.

@ralight ralight closed this Sep 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
2 participants
You can’t perform that action at this time.