mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-08 04:02:27 +00:00
Implement server session ticket support with mbedtls
Closes https://github.com/espressif/esp-idf/pull/7048 Signed-off-by: Aditya Patwardhan <aditya.patwardhan@espressif.com>
This commit is contained in:

committed by
Aditya Patwardhan

parent
8f283421da
commit
7e886ca9ed
@@ -145,6 +145,7 @@ static void free_secure_context(void *ctx)
|
||||
if (cfg->serverkey_buf) {
|
||||
free((void *)cfg->serverkey_buf);
|
||||
}
|
||||
esp_tls_cfg_server_session_tickets_free(cfg);
|
||||
free(cfg);
|
||||
free(ssl_ctx);
|
||||
}
|
||||
@@ -160,6 +161,16 @@ static httpd_ssl_ctx_t *create_secure_context(const struct httpd_ssl_config *con
|
||||
free(ssl_ctx);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (config->session_tickets) {
|
||||
if ( esp_tls_cfg_server_session_tickets_init(cfg) != ESP_OK ) {
|
||||
ESP_LOGE(TAG, "Failed to init session ticket support");
|
||||
free(ssl_ctx);
|
||||
free(cfg);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
ssl_ctx->tls_cfg = cfg;
|
||||
/* cacert = CA which signs client cert, or client cert itself , which is mapped to client_verify_cert_pem */
|
||||
if(config->client_verify_cert_pem != NULL) {
|
||||
|
Reference in New Issue
Block a user