Open DracoTomes opened 9 months ago
Hello @DracoTomes, That's a good question indeed ☺️ I don't have much time at the moment, but it would be interesting to review how SSL (TLS) works in MicroPython. I know that SSLContext was required for this to work. (The server works very well in SSL on a Unix market (it does asynchronous and concurrent concurrency)).
I use it in production!
Is this really urgent for you? 🚀
No this is not urgent.
Originally I also failed here
I then tried replacing the create_default_context
with something like this
ctx = new ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
try:
load_verify_locations(caFile)
except :
raise ValueError('"caFile" must indicate a valid PEM file.')
but then had the issue that the new SSLContext does not implement .fileno()
and this failed:
and I gave up.
I guess the first interesting thing is how much work you roughly estimate this would take, if feasible at all?
I don't know how long it would take with MicroPython because it would be important for me to get the ESP32 boards out and have a bit of time (I'm setting up a business at the moment and I've got a lot of work to do). However, I see that SSLContext now seems to exist in MicroPython and fileno() exists in socket objects normally.
https://docs.micropython.org/en/latest/library/ssl.html#class-sslcontext
I just tried enabling SSL on my MicroPython project and had a pretty bad time. I only afterwards stumbled on this Issue, basically stating HTTPS is not supported on MicroPython.
Given that MicroPython has recently started redoing a lot of the ssl Implementation how willing are you to have a look at what it would take to implement this into the XAsyncSockets library?