← index #408Issue #8647
Related · high · value 0.751
QUERY · ISSUE

No Example for uasyncio SSL webserver

openby Asanga-Virajopened 2021-01-12updated 2021-01-12

No example for uasyncio SSL webserver. Also couldn't find any on the internet. Looking for support.

CANDIDATE · ISSUE

Need solution for asyncio SSL/TLS connections

closedby RuofengXopened 2022-05-10updated 2023-12-14

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.

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied