Commit 35d41dbb0e changed the API for using
SSL with umqtt, but only did a minor version increase. This broke various
uses of this library, eg
https://github.com/aws-samples/aws-iot-core-getting-started-micropython
Reinstate the original API for specifying an SSL connection. This library
now supports the following:
- default, ssl=None or ssl=False: no SSL
- ssl=True and optional ssl_params specified: use ssl.wrap_socket
- ssl=<SSLContext instance>: use provided SSL context to wrap socket
Signed-off-by: Damien George <damien@micropython.org>
If there are any network issues, mqtt will block on the socket
non-deterministically. This commit introduces a `timeout` option which
can be used to set a finite timeout on the socket. Upon any issue, mqtth
lib will throw exception.
This changes almost all uses of "u-module" to just "module" for the
following built-in modules:
- binascii
- collections
- errno
- io
- json
- socket
- struct
- sys
- time
There are some remaining uses of "u-module" naming, for the cases where the
built-in module is extended in Python, eg `python-stdlib/os` uses `uos`.
Also, there are remaining uses of `utime` when non-standard (compared to
CPython) functions are used, like `utime.ticks_ms()`.
Signed-off-by: Damien George <damien@micropython.org>
MicroPython now supplies SSL/TLS functionality in a new built-in `tls`
module. The `ssl` module is now implemented purely in Python, in this
repository. Other libraries are updated to work with this scheme.
Signed-off-by: Felix Dörre <felix@dogcraft.de>
There don't seem to be any MQTT implementations that expect an empty
username (instead of the field missing), so the check for unused `user` can
be simplified.
Signed-off-by: Felix Dörre <felix@dogcraft.de>