Page 1 of 1

ESP32 OTA Example pem file.

Posted: Sat Sep 29, 2018 6:45 am
by gyaneshsingh77
Hello All,
I am new to TLS topic. I am trying to integrate OTA example given in esp-idf (https://github.com/espressif/esp-idf/tr ... system/ota). I found following variable names declared as Extern.

extern const uint8_t server_cert_pem_start[] asm("_binary_ca_cert_pem_start");
extern const uint8_t server_cert_pem_end[] asm("_binary_ca_cert_pem_end");

on compilation I am getting error undeclared / undefined variable which is obvious.
I guess that these variables are declared in some other file or generated by script using .pem file as input. But the flow of generation I am not able to understand.

I have also generated ca_cert.pem and ce_key.pem file successfully as directed in the readme section.
It would be helpful if someone can help me to resolve the issue.

Thanks in advance
Gyanesh

Re: ESP32 OTA Example pem file.

Posted: Sun Sep 30, 2018 5:18 am
by chegewara

Re: ESP32 OTA Example pem file.

Posted: Mon Oct 01, 2018 6:44 am
by francescofcf
Generate self-signed certificate and key:
openssl req -x509 -newkey rsa:2048 -keyout ca_key.pem -out ca_cert.pem -days 365

when ask you the Common Name type your host-name
after Copy the generate certificate to server_certs directory inside OTA example directory.
read the workflow.

Re: ESP32 OTA Example pem file.

Posted: Wed Oct 24, 2018 8:16 am
by GyaneshSingh
Thanks to All,

The problem is resolved now. Problem was that I was trying to integrate pem file with esp-idf version 2.x which is not updated to take care of pem file binary integration. I cloned updated idf and its compiled successfully.

Thanks again.
Gyanesh

Re: ESP32 OTA Example pem file.

Posted: Thu Oct 25, 2018 11:34 am
by Fiskelin
I am using esp-idf-v3.1 but still get this error. Please help

Re: ESP32 OTA Example pem file.

Posted: Thu Oct 25, 2018 11:56 am
by Fiskelin
I integrate the OTA function to my firmware and following error occur during compilation. Please help
media/sf_ESP32/esp/simple_wifi/build/main/libmain.a(simple_wifi.o):(.literal.UserOTA+0xc): undefined reference to `_binary_ca_cert_pem_start'

Re: ESP32 OTA Example pem file.

Posted: Tue Jan 08, 2019 12:39 pm
by LudoDr
I had the same problem, solved it by adding the following line in component.mk
COMPONENT_EMBED_TXTFILES := ${PROJECT_PATH}/server_certs/ca_cert.pem

Re: ESP32 OTA Example pem file.

Posted: Thu Feb 20, 2020 10:45 am
by om3gaki113r
i had to add below line to the CMakeLists file as well

set(COMPONENT_EMBED_TXTFILES ${PROJECT_PATH}/server_certs/ca_cert.pem)