-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Not cacert parameter in micropython/extmod/modussl_mbedtls.c #3687
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I have applied based on your guidance in the link Directly i added key and cert inside of main.py as follows;
mqtt.py (Line 69):
However, right now, It is waiting during the connection and about after 15 secs, i have received following error
I think that it is caused by the missing of "ca_cert" certificate. I will be glad if you share your opinions about the issue. Thanks... |
Dear @dpgeorge , |
@Sunrise17 Did you manage to get it working ? I am also trying to get SSL working for my WebSocket connection on the ESP32. |
@Silps , Unfortunately over mqtt to AWS IoT, i could not succeed to connect but normally it's connecting well other ssl required socket servers (without ca_cert parameter). |
@Sunrise17 Can you give me some example code and possibly a server hostname (if public) to try it on? I am currently unsure how to use the ssl library, I tried this.
|
@Silps , You can use following code below;
|
@Sunrise17 The server you provided is unreachable for me. I tried using the key and cert above you provided earlier to connect to google.com. Once I use the wrap_socket my ESP32 reboots. I guess you also had this problem before.
When I try again with google.com and my own generated key and cert then I got this. Looks a bit better I guess.
|
@Silps what is the version of your micropython on ESP32 board? if it is not 1.9.4, please flash your device with following fw: esp32-20180701-v1.9.4-227-gab02abe9.bin |
@Sunrise17 I am using the latest firmware yes, just updated it also and tried again. Same error with google.com. Did you try google.com and it works ?
I used the following to create the cert and key. I am suspecting this is not correct, that is why the handshake fails.
|
It is connecting to my SSL server as follows but i could not connect your IP, i think you should check your configuration. In addition, please be aware that your ESP board is connected to internet, because in this last version, it delays and sometimes it connects after 15secs, that's why you should add some delay before making your ssl request.
|
Ok thanks a lot for the help. I will try to figure it out. Seems like some configuration issue yes, with the cert maybe etc. |
…n-main Translations update from Weblate
I'll close this as a duplicate of #3646, with the issue being that |
Dear @dpgeorge ,
I am trying to establish SSL connection to AWS IoT via ESP32. Normally i have below three files (certs and key) in flash folder.
KEY_PATH = "/flash/cert/deviceCert.key"
CERT_PATH = "/flash/cert/deviceCertAndCACert.pem"
CACERT_PATH = "/flash/cert/root.pem"
In first, i defined the ssl_params={"certfile":CERT_PATH, "keyfile":KEY_PATH, "ca_certs":CACERT_PATH}) as like that but i was always getting "Error in mqtt connect: [Exception] TypeError: extra keyword arguments given." error.
Then, i have checked the modussl_mbedtls.c in extmod and SSL parameters are defined as like in struct below (Line 59).
i have adjusted the ssl_params={"cert":CERT_PATH, "key":KEY_PATH})
I have tried to create connection without using cacert.
Then, it started to try establishing connection but i have received following error then board reboots.
I will be glad if it is possible to add "cacert" parameter inside arguments of ussl module.
Thanks for your efforts...
The text was updated successfully, but these errors were encountered: