Avoid certificate substitution during OTA
Posted: Fri Apr 23, 2021 10:28 am
Hi,
I'm currently working with several ESP32 and OTA updates.
Since my app uses SSL/TLS certificates, I currently uses the following lines of code to get my .pem certificates from my project/server_certs folder and use them in my HTTPS client config :
Since I want to implement OTA for several ESP32 devices and update them all at the time using HTTPS OTA, I want to make sure they keep their own SSL certificate, meaning that I want to find a way to save the certificates somewhere in the memory that will not be erased during OTA update.
Any advice about the way to do this?
Thanks for your help
I'm currently working with several ESP32 and OTA updates.
Since my app uses SSL/TLS certificates, I currently uses the following lines of code to get my .pem certificates from my project/server_certs folder and use them in my HTTPS client config :
Code: Select all
const uint8_t server_cert_pem_start[] asm("_binary_ca_cert_pem_start");
const uint8_t server_cert_pem_end[] asm("_binary_ca_cert_pem_end");
...
esp_http_client_config_t config = {
...,
.cert_pem = (char *)server_cert_pem_start,
...
};
Any advice about the way to do this?
Thanks for your help