Add very basic example for mqtt tls#458
Merged
Merged
Conversation
|
Thanks for this PR! Adding the ssl_params seemed to be the magic required to get a working connection with a HiveMQ broker. |
dpgeorge
approved these changes
Jun 30, 2026
dpgeorge
left a comment
Member
There was a problem hiding this comment.
Thanks for the PR, and sorry this took forever to review.
I tested it with mosquitto in TLS mode and it worked.
a68e8b3 to
5de65d1
Compare
Signed-off-by: Damien George <damien@micropython.org>
5de65d1 to
d966d76
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tested on next setup:
Note:
Unable connect without
ssl_params = {"server_hostname": "<addr>"}If
keepalive= 0 (default) gotMQTTException(2)Don't found
ssl.CERT_XXXorussl.CERT_XXXconstants,although the constants are specified in the documentation.
Only found in inner definitions. But didn't understand how use it outside:
micropython-lib/python-stdlib/ssl/ssl.py
Lines 5 to 7 in 3c383f6
Not sure if all of this is bad defaults or this behavior made by design.