micropython-lib
micropython-lib copied to clipboard
Add very basic example for mqtt tls
Tested on next setup:
- MicroPython 1.17 (without ca-cert's)
- Traefik Proxy 2.5 (Let's Encrypt Cert)
- Mosquitto 2.0.12
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: https://github.com/micropython/micropython-lib/blob/3c383f6d2864a4b39bbe4ceb2ae8f29b519c9afe/python-stdlib/ssl/ssl.py#L5-L7Not sure if all of this is bad defaults or this behavior made by design.