gnutls_x509_crt_deinit(cert);
+ /* Send a bogus request to the server. Otherwise recent gnutls-serv won't
+ * terminate the connection when gnutls_bye() is used. */
+ gnutls_record_send(session, "GET / HTTP/1.0\r\n\r\n",
+ strlen("GET / HTTP/1.0\r\n\r\n"));
+
gnutls_bye(session, GNUTLS_SHUT_RDWR);
fclose(fd_read);
fclose(fd_write);