
// Initiate an orderly connection shutdown.
ret = gnutls_bye(session, GNUTLS_SHUT_RDWR);
if (ret < 0) {
  fprintf(stderr, "error: gnutls_bye: %s\n", gnutls_strerror(ret));
  exit(1);
}
// Free the session object.
gnutls_deinit(session);

