NAME
SSL_shutdown — shut down a TLS/SSL connectionDESCRIPTION
SSL_shutdown() shuts down an active TLS/SSL connection. It sends the “close notify” shutdown alert to the peer.NOTES
SSL_shutdown() tries to send the “close notify” shutdown alert to the peer. Whether the operation succeeds or not, the SSL_SENT_SHUTDOWN flag is set and a currently open session is considered closed and good and will be kept in the session cache for further reuse.RETURN VALUES
The following return values can occur:- 0
- The shutdown is not yet finished. Call SSL_shutdown() for a second time, if a bidirectional shutdown shall be performed. The output of SSL_get_error(3) may be misleading, as an erroneous SSL_ERROR_SYSCALL may be flagged even though no error occurred.
- 1
- The shutdown was successfully completed. The “close notify” alert was sent and the peer's “close notify” alert was received.
- −1
- The shutdown was not successful because a fatal error occurred either at the protocol level or a connection failure occurred. It can also occur if action is need to continue the operation for non-blocking BIOs. Call SSL_get_error(3) with the return value ret to find out the reason.