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

Support for ALPN in Mosquitto #924

Closed
santoshks68 opened this issue Aug 19, 2018 · 5 comments

Comments

Projects
None yet
4 participants
@santoshks68
Copy link

commented Aug 19, 2018

To connect to AWS IOT Broker on port 443, one needs to specify the ALPN protocol for AWS i.e. “x-amzn-mqtt-ca”. Since currently there is no direct way to do this using the Mosquitto API client library, one needs to instantiate a SSL_CTX object instead of relying on the one Mosquitto internally creates. With this SSL_CTX it is possible to set the ALPN protocol using the OpenSSL API, SSL_CTX_set_alpn_protos. Once this is done, the Mosquitto client instance is initialized with this SS_CTX object using opts_set(mosq_opt_t::MOSQ_OPT_SSL_CTX, ...). This works. The problem is during reconnect , this bit of jugglery is not accounted for and hence reconnect fails. It would be a good feature to enable setting the ALPN protocol at the Mosquitto API which would in turn make it simpler to handle the reconnect scenarios. The alternative would be to consider that a developer might need to provide his own SSL_CTX object (for whatever reasons) and since Mosquitto does allow you to do so, it should also consider this during reconnect!

@toast-uz

This comment has been minimized.

Copy link
Contributor

commented Aug 19, 2018

Supporting ALPN is useful for not only the client but also the bridge of mosquitto.

@ralight ralight added this to the 1.6 milestone Aug 19, 2018

@ralight

This comment has been minimized.

Copy link
Contributor

commented Aug 19, 2018

Sounds like a sensible request.

@rOY369

This comment has been minimized.

Copy link

commented Aug 31, 2018

Any update on ALPN support for Mosquitto bridging and otherwise as well ?

@santoshks68

This comment has been minimized.

Copy link
Author

commented Oct 25, 2018

Is there a time frame when this enhancement will be made available? Basically, is there any timeline for milestone 1.6?

@ralight

This comment has been minimized.

Copy link
Contributor

commented Apr 16, 2019

This is fixed in 1.6, which will be released tomorrow.

@ralight ralight closed this Apr 16, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.