I’m trying to implement SSL session resumption (aka RFC 5077) between a low power device and a cloud server. In between the first and subsequent connections, my device completely loses power, and as such cannot retain anything in RAM.
For this to work, according to this post: https://tls.mbed.org/discussions/generic/resumed-tls-handshake one has to store the result of
mbedtls_ssl_get_session to some sort of non-volatile memory and then restore it again using
mbedtls_ssl_set_session. However, the
mbedtls_ssl_session structure is fairly complex and contains several heap pointers.
Is there any functionality in mbedtls to serialize this structure into a byte string for easy storage purposes? Or is this something I should implement myself?
I can see that there is something for writing tickets to a byte string, but nothing for writing the entire session structure.