-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
Description
I am running esp32c3-usb-20220117-v1.18.bin
TL;DR
How to open a SSL or TLS connection using uasyncio?
I am tryign to port a CPython project onto Micropython.
In CPython asyncio, we could open a SSL connection easily by using ssl argument in asyncio.open_connection() method.
When I am trying to use uasyncio.open_connection(..., ssl=True), it raises an exception saying that there's no ssl argument. We can confirm it on the doc page here.
Then I try to use ssl module to warp the socket in StreamWriter.get_extra_info("socket")(I never test this, I don't know whether this would work, just have a try), but I cannot get the "raw" socket of this connection, because function uasyncio.Stream.get_extra_info only accept "peername" as a param, no support for "socket". We can check it here.
If there's a method to open an SSL/TLS connection by using uasyncio? I really want to use asyncio because I think that is the best part of python language.