mbedtls_ssl_context::tls_version field
Maximum TLS version to be negotiated, then negotiated TLS version. It is initialized as the configured maximum TLS version to be negotiated by mbedtls_ssl_setup(). When renegotiating or resuming a session, it is overwritten in the ClientHello writing preparation stage with the previously negotiated TLS version. On client side, it is updated to the TLS version selected by the server for the handshake when the ServerHello is received. On server side, it is updated to the TLS version the server selects for the handshake when the ClientHello is received.