Reading Certificates from Spiffs partition on the flash memory of esp32

saransh.goel
Posts: 2
Joined: Thu Apr 02, 2020 6:32 pm

Reading Certificates from Spiffs partition on the flash memory of esp32

Postby saransh.goel » Wed May 27, 2020 6:45 am

I am able to flash the certificates on siffs partition and access the certificates using file handling but how do i load then for SSL server certification and esp_http_client_config_t.

I was previously embedding the certificates into the firmware using the components.mk file like this

Code: Select all

COMPONENT_EMBED_TXTFILES = device_cert.pem
and then using them like this

Code: Select all

extern const uint8_t device_cert_pem_start[]   asm("_binary_device_cert_pem_start");
extern const uint8_t device_cert_pem_end[]   asm("_binary_device_cert__pem_end");
But I don't know how to load them from the spiffs partition in the flash memory. Can somebody please help me out ?

Thanks
Saransh Goel

RMandR
Posts: 75
Joined: Mon Oct 29, 2018 3:13 pm

Re: Reading Certificates from Spiffs partition on the flash memory of esp32

Postby RMandR » Thu May 28, 2020 8:50 pm

@saransh.goel

Have a look at this post. I asked for a similar purpose:

https://esp32.com/viewtopic.php?f=13&t=12963

In my case, I ended up copying the certificate data into RAM and passing them to the APIs.

It looks like you may have to do the same:

https://docs.espressif.com/projects/esp ... _config__t

Who is online

Users browsing this forum: No registered users and 64 guests