Page 1 of 1

SSL(Web)REPL + SHELL

Posted: Sun Jan 12, 2020 1:43 pm
by cgglzpy
Hi, I somehow managed to make a REPL / SHELL that works over SSL, which basically looks like this :
Image

It still NEEDS WebREPL enabled for the initial logging and after that the SSL REPL is initiated ("os.dupterm" on a ssl wrapped socket).
Right now with client authentication only, since server authentication in MicroPython is still missing? (At least esp32 port).

Sadly for esp8266 SSL seems to be not fast enough (I've just manage to make the handshake which took quite a bit and after that it just freezes :? )

However I made the exactly same (90%) REPL/SHELL working over WebREPL and Serial (so esp8266 and pyboard works too)
This is included in last version of upydev, so to install and read more about it see the README/DOCS: SSLWebREPL docs

It is still a WIP, but I think is ready for some testing :)

Cheers

Re: SSL(Web)REPL + SHELL

Posted: Sun Jan 12, 2020 5:03 pm
by tve
This looks very promising! I'm tired of all the insecure protocols everywhere... Thanks for sharing!

Re: SSL(Web)REPL + SHELL

Posted: Mon Jan 13, 2020 3:34 pm
by cgglzpy
Hi, thanks

I forgot to mention that file transfer (get/put commands) are also done over SSL and SHELL / REPL comes with all sort of autocompletions :)
tve wrote:
Sun Jan 12, 2020 5:03 pm
This looks very promising! I'm tired of all the insecure protocols everywhere... Thanks for sharing!
I don't know if this is "secure" or not, but I guess it is a step towards this direction.
Also I think this opens the door to a future Websocket Secure implementation of WebREPL maybe? Although I don't know if anyone is interested in this... :roll:

Anyway if anyone is interested in how the SHELL / REPL is made have a look at this awesome library : https://python-prompt-toolkit.readthedocs.io/en/master/