Page 1 of 1

ussl.CERT_NONE

Posted: Mon Sep 14, 2020 5:43 pm
by ttadam
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! :)

Re: ussl.CERT_NONE

Posted: Tue Sep 15, 2020 12:16 am
by jimmo
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!

Re: ussl.CERT_NONE

Posted: Wed Sep 16, 2020 12:52 pm
by ttadam
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...