mbedtls_ssl_get_session() is only used within mbedTLS.
 
Symbols
loading...
Files
loading...
SummarySyntaxArgumentsRelatedReferences

Return value

0 if successful, MBEDTLS_ERR_SSL_ALLOC_FAILED if memory allocation failed, MBEDTLS_ERR_SSL_BAD_INPUT_DATA if used server-side or arguments are otherwise invalid.

Notes

Only the server certificate is copied, and not the full chain, so you should not attempt to validate the certificate again by calling \c mbedtls_x509_crt_verify() on it. Instead, you should use the results from the verification in the original handshake by calling \c mbedtls_ssl_get_verify_result() after loading the session again into a new SSL context using \c mbedtls_ssl_set_session(). Once the session object is not needed anymore, you should free it by calling \c mbedtls_ssl_session_free().

References

from examples