Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HELP WANTED - The web app cannot yet use SSL #86

Open
connornishijima opened this issue Apr 30, 2024 · 1 comment
Open

HELP WANTED - The web app cannot yet use SSL #86

connornishijima opened this issue Apr 30, 2024 · 1 comment
Assignees
Labels
bug Something isn't working enhancement New feature or request help wanted Extra attention is needed

Comments

@connornishijima
Copy link
Collaborator

connornishijima commented Apr 30, 2024

Note: Some of the info below is out of date, the most recent comment contains updated information about the state of SSL support

Emotiscope uses the PsychicHTTP Arduino library. It's a swiss army knife that handles a whole HTTP server, websockets server, and more.

However, I haven't figured out its coolest feature: HTTPS/SSL.

Like, I know how I'm supposed to implement it, and have a server cert and key, but it just doesn't work.

A potential reason it doesn't work is the madness going on with my platformio.ini. For the sake of the I2S microphone and the new RMT LED driver, I needed an Arduino framework in PlatformIO that used ESP-IDF 5.x. The Arduino for ESP32 3.0.0-beta uses IDF 5.x, so Emotiscope was built on that. But because that IDF port is in beta, maybe the SSL/encryption side of the PsychicHTTP library isn't happy about that.

So currently, the SSL-enabled "app.emotiscope.rocks" page redirects you to a plain HTTP webserver running on your Emotiscope, since you can't send websockets commands from an HTTPS page to an unsecured one.

Honestly though, PsychicHTTP is now the only thing left in the system that explicitly requires an Arduino framework. Here's an idea:

Some time down the road, I want to port Emotiscope to ESP-IDF (No PlatformIO) and use only the IDF to enable an encrypted wss:// connection between the HTML page @ app.emotiscope.rocks and Emotiscope. That way, Emotiscope doesn't spend CPU cycles hosting an entire webserver off of itself while it runs, the code for the Emotiscope web-app is already open-source right now, it would just be hosted online instead, or by yourself remotely.

OR...

If I can get SSL working on PsychicHTTP I can skip all of that entirely and still host the web app from Emotiscope itself.

Questions For You:

  • Could Emotiscope keep only the public key for a WSS:// connection? SSL isn't my strong suit.
  • If not, how would I even store the private SSL key into the ESP32-S3/this repository in a way that doesn't expose it, defeating the purpose of a private key?
  • If the key isn't hosted in the repo, how would DIY builds get connected?
  • Don't keys expire? How on earth would I embed one anyways if that's the case?
@connornishijima connornishijima added bug Something isn't working help wanted Extra attention is needed labels Apr 30, 2024
@connornishijima connornishijima self-assigned this Apr 30, 2024
@connornishijima connornishijima pinned this issue Apr 30, 2024
@connornishijima connornishijima added the enhancement New feature or request label Apr 30, 2024
@connornishijima connornishijima unpinned this issue Jul 3, 2024
@connornishijima
Copy link
Collaborator Author

connornishijima commented Jul 3, 2024

Note: the upcoming Emotiscope 2.0.0 Multiplayer Update drops the PsychicHTTP library altogether, using the bare ESP-IDF framework instead of Arduino. wss:// may now be working, but I haven't tried it yet.

I'm still very confused on how to include HTTPS keys in a product without exposing them, or wondering why I'd care if I exposed them anyways in this instance where a client-side app is making a local TCP connection to a fellow device inside your WiFi network with your consent. Any man-in-the-middle attacker would have to already be connected to your home WiFi network to manipulate your Emotiscope to do... what? Change the brightness?

@connornishijima connornishijima pinned this issue Jul 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant