mirror of
https://github.com/espressif/esp-idf.git
synced 2026-07-13 22:43:25 +03:00
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.
This commit is contained in:
@@ -211,9 +211,9 @@ static httpd_handle_t start_webserver(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;
|
||||
conf.server_key = &server_key;
|
||||
|
||||
#if CONFIG_EXAMPLE_ENABLE_HTTPS_SERVER_CUSTOM_CIPHERSUITES
|
||||
|
||||
@@ -216,9 +216,9 @@ static httpd_handle_t start_wss_echo_server(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;
|
||||
conf.server_key = &server_key;
|
||||
|
||||
esp_err_t ret = httpd_ssl_start(&server, &conf);
|
||||
|
||||
Reference in New Issue
Block a user