Communicate with ESP from HTTPS website
Posted: Sun Aug 24, 2025 12:45 pm
I’m interacting with an HTTP server hosted on an ESP, mainly to upload new firmware, but also to get some status information. Everything works when the website that communicates with the ESP runs over plain HTTP, but once I serve the website over HTTPS, direct communication with the ESP breaks.
The question is: what’s the simplest way for an HTTPS site to talk to the ESP with minimal user steps? Can the ESP automatically obtain a valid certificate generated on the ESP itself (e.g. via Let’s Encrypt), or is there an alternative that avoids manually generating and copying a certificate to the device? Since this project is aimed at end users, solutions that depend on local DNS setups or reverse proxies aren’t practical.
I experimented with self-signed certs, but that forces users to visit the ESP’s page and approve the certificate. I also ran into connection drops in some cases.
Use cases that should be supported:
The question is: what’s the simplest way for an HTTPS site to talk to the ESP with minimal user steps? Can the ESP automatically obtain a valid certificate generated on the ESP itself (e.g. via Let’s Encrypt), or is there an alternative that avoids manually generating and copying a certificate to the device? Since this project is aimed at end users, solutions that depend on local DNS setups or reverse proxies aren’t practical.
I experimented with self-signed certs, but that forces users to visit the ESP’s page and approve the certificate. I also ran into connection drops in some cases.
Use cases that should be supported:
- Upload firmware to the ESP
- Read and write serial messages (via websockets or something similar)