peterhinch / micropython-mqtt

A 'resilient' asynchronous MQTT driver. Recovers from WiFi and broker outages.
MIT License
549 stars 116 forks source link

Change ussl to ssl #142

Closed sgbaird closed 3 weeks ago

sgbaird commented 3 weeks ago

At least on Pico W, MicroPython 1.23.0 no longer has ussl. Instead it only has ssl (which was also available before 1.23.0).

Not sure if something will be changed later. https://github.com/micropython/micropython/releases/tag/v1.23.0

sgbaird commented 3 weeks ago

Thanks for the report - I was under the impression that u-names were being retained to avoid breakages. I think this would be safer, given that some users may be running old firmware.

if self._ssl:
    try:
        import ssl
    except ImportError:
        import ussl as ssl

followed by your later change.

@peterhinch, agreed! Added

peterhinch commented 3 weeks ago

Thank you.