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

regression: mosquitto_pub,sub fail @ client hello when PSK TLS used on port 8883 #2152

Closed
jetpax opened this issue Mar 26, 2021 · 2 comments
Closed
Milestone

Comments

@jetpax
Copy link

jetpax commented Mar 26, 2021

tested to mosquitto broker setup for tls - psk from mosquitto_sub version 2.0.9 running on libmosquitto 2.0.9, (with no certificates)

e.g
mosquitto_sub -h -p 8883 -t test --psk-identity --psk

fails at Client Hello, since no pre_shared_key Extension is transmitted to the broker

Using another port, eg 8884, proceeds to server hello and connects as expected
e.g
mosquitto_sub -h -p 8884 -t test --psk-identity --psk

in this case the pre_shared_key Extension is transmitted, which contains the PSK Identity

mosquitto_sub version 1.6.9 running on libmosquitto 1.6.9 connects fine using port 8883

Possibly related to changes in 2.0.0 - 2020-12-03
- The mosquitto_sub, mosquitto_pub, and mosquitto_rr clients will now load OS provided CA certificates by default if -L mqtts:https://... is used, or if the port is set to 8883 and no other CA certificates are loaded.

mosquitto_pub shows the same failure pattern

Seems like client_shared.c l.1266 should be something like

}else if(cfg->port == 8883 && !cfg->psk){

ralight added a commit that referenced this issue Mar 26, 2021
@ralight ralight added this to the 2.0.10 milestone Mar 26, 2021
@ralight
Copy link
Contributor

ralight commented Mar 26, 2021

Thank you, I've fixed that in the fixes branch. Your suggestion was correct, I've just done it slightly differently.

@ralight ralight closed this as completed Mar 26, 2021
@jetpax
Copy link
Author

jetpax commented Mar 26, 2021

Thank you for the quick fix, much more elegant!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants