mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2025-08-04 13:34:38 +08:00

According to mbedTLS source code and documentation, calls to `mbedtls_ssl_conf_session_cache` and `mbedtls_ssl_conf_session_tickets_cb` are only available if mbedTLS is configured for server mode (ie. MBEDTLS_SSL_SRV_C is defined). This cannot be used on client mode to resume a previous session. To allow session reuse in client mode, application must save session parameters (including tickets provided by the server if any) after successfull connection and restore them before attemting to reconnect. Since `alctp_close()` free the structure, it cannot be used to store the required information. So, two new API were added, directly wrapped to mbedTLS functions, allow application to do that by itself. Also added full declaration of `struct altcp_tls_session` in altcp_tls.h to allow easier usage in application when using mbedTLS port.