Arm Mbed OS support forum

Does mbedtls_ssl_set/get_session() support DTLS handshake?

I am trying to resume a DTLS handshake. I have used the API mbedtls_ssl_set/get_session(). The followings are the sequences:

  1. Perform mbedtls_ssl_handshake().
  2. mbedtls_ssl_get_session() and mbedtls_ssl_session_save();
  3. mbedtls_ssl_session_reset()
  4. mbedtls_ssl_session_load() and mbedtls_ssl_set_session()
  5. Do another mbedtls_ssl_handshake().

However, the handshake is still a full handshake. I can’t seem to produce these session resumption DTLS events:
client: 0:1 handshake client_hello 167 B
server: 0:1 handshake client_hello 167 B
server: 0:1 handshake server_hello 90 B
server: 0:2 change_cipher_spec - 1 B

Could you please confirm if these APIs support DTLS because I have found this forum ticket: Resumed TLS session with DTLSSockets ?


Yes, the low level Mbed TLS API supports DTLS, see The DTLSSocket class actually calls this API.

The ticket you referenced only addresses the fact that session resumption is not supported on the (higher level) DTLSSocket class.