/* Close the TLS connection and free any allocated resources.  */
void esp_tls_conn_delete(esp_tls_t *tls)
/* Close the TLS connection and free any allocated resources.  */
void esp_tls_conn_delete(esp_tls_t *tls)
{
    if (tls != NULL) {
        mbedtls_cleanup(tls);
        if (tls->sockfd) {
            close(tls->sockfd);
        }
        free(tls);
    }
}