ussl.CERT_NONE

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
Post Reply
ttadam
Posts: 18
Joined: Sun Apr 26, 2020 3:36 pm

ussl.CERT_NONE

Post by ttadam » Mon Sep 14, 2020 5:43 pm

Hello there,

I would like to use robust mqtt client (https://github.com/fizista/micropython-umqtt.robust2),
and I run into an issue. I want to connect with ssl, and ssl params should be CERT_NONE, but on my implementation of micropython (wesp32 with 1.13 version of ESP-IDF v3.x, (only v3.x has lan support)) has no attribute as CERT_NONE.
Do you have some recomendation how to overcome this issue?
Thanks in advance! :)

User avatar
jimmo
Posts: 2754
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: ussl.CERT_NONE

Post by jimmo » Tue Sep 15, 2020 12:16 am

ttadam wrote:
Mon Sep 14, 2020 5:43 pm
Do you have some recomendation how to overcome this issue?
The docs are a bit confusing for historical reasons (the ussl module differents between different MicroPython ports, but the docs are for the CC3200 version).

On every other port, the cert_reqs argument isn't supported. You don't need to specify it.

Some improvements to ussl are currently in progress!

ttadam
Posts: 18
Joined: Sun Apr 26, 2020 3:36 pm

Re: ussl.CERT_NONE

Post by ttadam » Wed Sep 16, 2020 12:52 pm

jimmo wrote:
Tue Sep 15, 2020 12:16 am
ttadam wrote:
Mon Sep 14, 2020 5:43 pm
Do you have some recomendation how to overcome this issue?
The docs are a bit confusing for historical reasons (the ussl module differents between different MicroPython ports, but the docs are for the CC3200 version).

On every other port, the cert_reqs argument isn't supported. You don't need to specify it.

Some improvements to ussl are currently in progress!
Thats sound promising! :)
I see so if I use the robust2 library insteand of this:

Code: Select all

client = MQTTClient("deviceid", "url", port = 8883, user=b"user", password=b"pass",ssl=True, ssl_params = {'cert_reqs':ussl.CERT_NONE} )
I just should use this:

Code: Select all

client = MQTTClient("deviceid", "url", port = 8883, user=b"user", password=b"pass",ssl=True )
I am asking this, because I tried it and I got nothing for client.connect() but for

Code: Select all

client.is_conn_issue() 
i got this:

Code: Select all

MQTT (connect): OSError(12,)
True
So something is still not okay...

teltonique21
Posts: 11
Joined: Fri Mar 04, 2022 9:47 am

Re: ussl.CERT_NONE

Post by teltonique21 » Fri Mar 04, 2022 10:18 am

jimmo wrote:
Tue Sep 15, 2020 12:16 am
ttadam wrote:
Mon Sep 14, 2020 5:43 pm
Do you have some recomendation how to overcome this issue?
The docs are a bit confusing for historical reasons (the ussl module differents between different MicroPython ports, but the docs are for the CC3200 version).

On every other port, the cert_reqs argument isn't supported. You don't need to specify it.

Some improvements to ussl are currently in progress!
can you tell me whether the Unix port on OpenWRT supports TLS? I would be annoyed if I tried so much to make the socket speak TLS only to find out the methods are not implemented! Unfortunately I'm using the compiled OpenWRT version of Micropython and I have no way to see the ussl source code for myself.

Post Reply