peterhinch / micropython-mqtt

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

Remove doc stating that TLS does not work on ESP32. #58

Closed Molaire closed 2 years ago

Molaire commented 2 years ago

Using Micropython 1.16-135, I have found out that ESP32 can in fact run an encrypted connection and communicate with it on non-blocking sockets.

Certificate and key were made using RSA2048b with AWS IoT service. They were pushed in the config like so: config['ssl_params'] = {'cert: 'content_of_cert', 'key': 'content_of_key'}

MicroPython v1.16-135-gaecb697c7-dirty on 2021-07-28; ESP32 module with ESP32
Type "help()" for more information.
>>> import tls32
Checking WiFi integrity.
Got reliable connection
Connecting to broker.
Connected to broker.
Wifi is  up
publish 0
Topic = result Count = 0 Retransmissions = 0 Retained = False
RAM free 82016 alloc 29152
publish 1
Topic = result Count = 1 Retransmissions = 0 Retained = False
RAM free 82016 alloc 29152
publish 2
Topic = result Count = 2 Retransmissions = 0 Retained = False
RAM free 82016 alloc 29152
publish 3
Topic = result Count = 3 Retransmissions = 0 Retained = False
RAM free 82016 alloc 29152
publish 4
Topic = result Count = 4 Retransmissions = 0 Retained = False
RAM free 82016 alloc 29152
publish 5
Topic = result Count = 5 Retransmissions = 0 Retained = False
RAM free 82016 alloc 29152
publish 6
Topic = result Count = 6 Retransmissions = 0 Retained = False
RAM free 82016 alloc 29152
publish 7
Topic = result Count = 7 Retransmissions = 0 Retained = False
RAM free 82016 alloc 29152
publish 8
Topic = result Count = 8 Retransmissions = 0 Retained = False
RAM free 82016 alloc 29152
publish 9
Topic = result Count = 9 Retransmissions = 0 Retained = False
RAM free 82016 alloc 29152
peterhinch commented 2 years ago

Thank you very much for testing this. I'm glad to see it's working at last.