1 2 3 4 5@deftypefun {int} {gnutls_bye} (gnutls_session_t @var{session}, gnutls_close_request_t @var{how}) 6@var{session}: is a @code{gnutls_session_t} type. 7 8@var{how}: is an integer 9 10Terminates the current TLS/SSL connection. The connection should 11have been initiated using @code{gnutls_handshake()} . @code{how} should be one 12of @code{GNUTLS_SHUT_RDWR} , @code{GNUTLS_SHUT_WR} . 13 14In case of @code{GNUTLS_SHUT_RDWR} the TLS session gets 15terminated and further receives and sends will be disallowed. If 16the return value is zero you may continue using the underlying 17transport layer. @code{GNUTLS_SHUT_RDWR} sends an alert containing a close 18request and waits for the peer to reply with the same message. 19 20In case of @code{GNUTLS_SHUT_WR} the TLS session gets terminated 21and further sends will be disallowed. In order to reuse the 22connection you should wait for an EOF from the peer. 23@code{GNUTLS_SHUT_WR} sends an alert containing a close request. 24 25Note that not all implementations will properly terminate a TLS 26connection. Some of them, usually for performance reasons, will 27terminate only the underlying transport layer, and thus not 28distinguishing between a malicious party prematurely terminating 29the connection and normal termination. 30 31This function may also return @code{GNUTLS_E_AGAIN} or 32@code{GNUTLS_E_INTERRUPTED} ; cf. @code{gnutls_record_get_direction()} . 33 34@strong{Returns:} @code{GNUTLS_E_SUCCESS} on success, or an error code, see 35function documentation for entire semantics. 36@end deftypefun 37