What is need for WebREPL to support "wss:"

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
Posts: 64
Joined: Wed Nov 01, 2017 7:46 am

What is need for WebREPL to support "wss:"

Post by HermannSW » Wed Oct 03, 2018 12:13 pm

I was totally surprised how easily "Long-lived connection" websocket client sample
https://pypi.org/project/websocket-clie ... connection

communication can be made secure

Code: Select all

$ diff ws.py wss.py 
> import ssl
<     ws = websocket.WebSocketApp("ws://echo.websocket.org/",
>     ws = websocket.WebSocketApp("wss://echo.websocket.org/",
<     ws.run_forever()
>     ws.run_forever(sslopt={"cert_reqs": ssl.CERT_NONE})
I used Wireshark to confirm:
https://twitter.com/HermannSW/status/10 ... 2433609728

Then I applied the same three changes to webrepl_client.py console client.
Unfortunately it hangs before ESP32 MicroPython even sends the Password prompt (traffic is SSL).
Initial handshake, successful push from webrepl_client.py to ESP32 with ACK, then nothing:

From the mentioned sample client above we know that "ws://echo.websocket.org/" as well as "wss://echo.websocket.org/" both work.
Does section of webrepl on not able to use "https:" indicate that WebREPL "wss:" is not implemented?
https://github.com/micropython/webrepl# ... icropython

The test at least proves that it is not enabled.

What is needed to either enable "wss:" or enhance WebREPL to support "wss:"?

Post Reply