ALPN protos causing HTTPS server to crash
Posted: Sat Jul 22, 2023 11:09 pm
I have recently upgraded my IDF from version 5.0.2 to 5.1. If ALPN is enabled then my server crashes on the first request to the server. It does not matter witch URI I do a request to. If ALPN is disabled everything works fine but the requests are slow (expected). The example in the IDF does work.
Panics regardless if I am in STA or AP mode.
Any advice?
I am using a ESP32-S3-WROOM-xx-xx.
This is the function that it Panics on.
Server config
Print before panic
Panic dump
Panics regardless if I am in STA or AP mode.
Any advice?
I am using a ESP32-S3-WROOM-xx-xx.
This is the function that it Panics on.
Code: Select all
int mbedtls_ssl_conf_alpn_protocols(mbedtls_ssl_config *conf, const char **protos)
Code: Select all
httpd_ssl_config_t config;
memset(&config,0,sizeof(httpd_config_t));
config.httpd.task_priority = 6;
config.httpd.stack_size = 32768;
config.httpd.core_id = tskNO_AFFINITY;
config.httpd.server_port = 0;
config.httpd.ctrl_port = 32769;
config.httpd.max_open_sockets = 4;
config.httpd.max_uri_handlers = 13;
config.httpd.max_resp_headers = 8;
config.httpd.backlog_conn = 5;
config.httpd.lru_purge_enable = true;
config.httpd.recv_wait_timeout = 5;
config.httpd.send_wait_timeout = 5;
config.httpd.global_user_ctx = NULL;
config.httpd.global_user_ctx_free_fn = NULL;
config.httpd.global_transport_ctx = NULL;
config.httpd.global_transport_ctx_free_fn = NULL;
config.httpd.enable_so_linger = false;
config.httpd.linger_timeout = 0;
config.httpd.keep_alive_enable = false;
config.httpd.keep_alive_idle = 0;
config.httpd.keep_alive_interval = 0;
config.httpd.keep_alive_count = 0;
config.httpd.open_fn = NULL;
config.httpd.close_fn = NULL;
config.httpd.uri_match_fn = NULL;
config.httpd.enable_so_linger = false;
config.servercert = servercert;
config.servercert_len = servercert_len;
config.cacert_pem = NULL;
config.cacert_len = 0;
config.prvtkey_pem = prvtkey_pem;
config.prvtkey_len = prvtkey_len;
config.transport_mode = HTTPD_SSL_TRANSPORT_SECURE;
config.port_secure = 443;
config.port_insecure = 0;
config.session_tickets = false;
config.use_secure_element = false;
config.user_cb = NULL;
config.ssl_userdata = NULL;
config.cert_select_cb = NULL;
return httpd_ssl_start(&_server, &config);
Code: Select all
I (9786) esp_https_server: performing session handshake
Code: Select all
Guru Meditation Error: Core 0 panic'ed (LoadProhibited). Exception was unhandled.
Core 0 register dump:
PC : 0x400556b4 PS : 0x00060330 A0 : 0x82031e1a A1 : 0x3fcbbf10
A2 : 0x00000169 A3 : 0x00000165 A4 : 0x000000ff A5 : 0x0000ff00
A6 : 0x00ff0000 A7 : 0xff000000 A8 : 0x42008bdc A9 : 0x3fcbbbb0
0x42008bdc: heap_task(void*) at I:/workspace/NIOE/main/main.cpp:32
A10 : 0x00000009 A11 : 0xffffffff A12 : 0x00000009 A13 : 0x00000000
A14 : 0x000001f4 A15 : 0x00000001 SAR : 0x00000004 EXCCAUSE: 0x0000001c
EXCVADDR: 0x00000169 LBEG : 0x400556d5 LEND : 0x400556e5 LCOUNT : 0xffffffff
Backtrace: 0x400556b1:0x3fcbbf10 |<-CORRUPTED
ELF file SHA256: 35e84d2bf8d54d54
Rebooting...