Problem with connect to MQTT via SSL/TLS

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
Post Reply
Spinoza
Posts: 2
Joined: Sat Jan 06, 2018 2:19 pm

Problem with connect to MQTT via SSL/TLS

Post by Spinoza » Sat Jan 06, 2018 2:34 pm

Hi. I have controller ESP8266 with MicroPython v1.9.3-8.

When I try to connect to MQTT without SSL - allready is good. When I try to connect with ssl like this:

[code]client = MQTTClient(CONFIG['CLIENT_ID'], CONFIG['MQTT_BROKER'], user=CONFIG['USER'], password=CONFIG['PASSWORD'], port=CONFIG['PORT'], ssl = True, ssl_params = {"cert_reqs":ussl.CERT_REQUIRED, "ca_certs":"/flash/cacert.pem"})[/code]

I have a error:

[code]AttributeError: 'module' object has no attribute 'CERT_REQUIRED'[/code]

It's strange, because in official doc (http://micropython.org/resources/docs/e ... /ussl.html) says that ussl.CERT_REQUIRED must be work, but it's not work =(

What could be the problem?

Thanks.

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: Problem with connect to MQTT via SSL/TLS

Post by pythoncoder » Sun Jan 07, 2018 5:15 pm

See the warning on the link you quote and the ESP8266 introduction.
Peter Hinch
Index to my micropython libraries.

Spinoza
Posts: 2
Joined: Sat Jan 06, 2018 2:19 pm

Re: Problem with connect to MQTT via SSL/TLS

Post by Spinoza » Wed Jan 10, 2018 6:31 am

[quote=pythoncoder post_id=24440 time=1515345320 user_id=265]
See the warning on the link you quote and [url=http://docs.micropython.org/en/latest/e ... ertificate]the ESP8266 introduction[/url].
[/quote]

Thanks a lot!

Post Reply