fix(esp-tls): Use runtime assignment for static key config length in examples

Linker symbol differences (prvtkey_pem_end - prvtkey_pem_start) are not
compile-time constants and cannot be used in static initializers.

(cherry picked from commit 4196734d1a)
This commit is contained in:
Aditya Patwardhan
2026-07-09 11:17:02 +05:30
parent b6bc9710a1
commit 6d7d89378c
3 changed files with 3 additions and 3 deletions
@@ -244,9 +244,9 @@ void start_esp_local_ctrl_service(void)
.source = ESP_KEY_SOURCE_BUFFER,
.buffer = {
.data = prvtkey_pem_start,
.len = prvtkey_pem_end - prvtkey_pem_start,
}
};
server_key.buffer.len = prvtkey_pem_end - prvtkey_pem_start;
https_conf.server_key = &server_key;
#else
httpd_config_t http_conf = HTTPD_DEFAULT_CONFIG();