I have a LilyGO SIM7000E. My project will send data periodically to a specific server. Just this one. In the planned end state there will be quite some modules running on solar power in remote places sending data over the mobile network and it would be an absolute hassle to update them on site.
A first prototype is working fine using WiFi via WiFiClientSecure and https requests. Mobile network implementation will come later.
My issue: I have the root CA of the the server storing the data hardcoded in the sketch. The root CA expiration date is in a little over 10 years but still I do not like the fact that at that point in time all modules will stop working. I therefore would like to periodically update (once every month?) the certificate at runtime and store it in SPIFFS. As far as I understand, the new root certificate will be published quite a while before the old one expires and therefore fetching the new certificate using the old one should not be a problem. I hope I got this right.
With regard to updating the root CA at runtime:
- Is this doable by the ESP32 directly accessing my server's root certifcate?
- If the above isn't possible, if I store the root certificate on my server as a (text) file, I can't see how the ESP32 couldn't download that (text) file via https? Since the root CA public key is what it says "public", I can't see any reason why storing the root CA as a file on my server could be of a security concern?
(For 2. to work I obviously need to make sure that the new root CA is stored on the server before the old one expires. This could be automated on the server side.)
TIA