mbedtls_ssl_session_load() function
Load serialized session data into a session structure. On client, this can be used for loading saved sessions before resuming them with mbedtls_ssl_set_session(). On server, this can be used for alternative implementations of session cache or session tickets. \warning If a peer certificate chain is associated with the session, the serialized state will only contain the peer's end-entity certificate and the result of the chain verification (unless verification was disabled), but not the rest of the chain. \see mbedtls_ssl_session_save() \see mbedtls_ssl_set_session()
Arguments
session
The session structure to be populated. It must have been initialised with mbedtls_ssl_session_init() but not populated yet.
buf
The buffer holding the serialized session data. It must be a readable buffer of at least \p len bytes.
len
The size of the serialized data in bytes.
Return value
\c 0 if successful. #MBEDTLS_ERR_SSL_ALLOC_FAILED if memory allocation failed. #MBEDTLS_ERR_SSL_BAD_INPUT_DATA if input data is invalid. #MBEDTLS_ERR_SSL_VERSION_MISMATCH if the serialized data was generated in a different version or configuration of Mbed TLS. Another negative value for other kinds of errors (for example, unsupported features in the embedded certificate).
mbedtls_ssl_session_load() is called by 2 functions and calls 2 functions:
![]()
mbedtls_ssl_session_load()
mbedtls_ssl_session_load():
![]()
mbedtls_ssl_session_load()