SSL_set_shutdown.pod revision 76866
198184Sgordon=pod 298184Sgordon 398184Sgordon=head1 NAME 498184Sgordon 598184SgordonSSL_set_shutdown, SSL_get_shutdown - manipulate shutdown state of an SSL connection 698184Sgordon 7153298Sdougb=head1 SYNOPSIS 8136803Smtm 9136224Smtm #include <openssl/ssl.h> 1098184Sgordon 1198184Sgordon void SSL_set_shutdown(SSL *ssl, int mode); 1298184Sgordon 1398184Sgordon int SSL_get_shutdown(SSL *ssl); 14298514Slme 15119166Smtm=head1 DESCRIPTION 16114769Sdougb 1798184SgordonSSL_set_shutdown() sets the shutdown state of B<ssl> to B<mode>. 18119166Smtm 19119166SmtmSSL_get_shutdown() returns the shutdown mode of B<ssl>. 20231194Sdougb 21231194Sdougb=head1 NOTES 22119166Smtm 23127222SgreenThe shutdown state of an ssl connection is a bitmask of: 24127222Sgreen 25127222Sgreen=over 4 26127222Sgreen 27127222Sgreen=item 0 28127222Sgreen 29127222SgreenNo shutdown setting, yet. 30127222Sgreen 31127222Sgreen=item SSL_SENT_SHUTDOWN 32127222Sgreen 33127222SgreenA "close notify" shutdown alert was sent to the peer, the connection is being 34127222Sgreenconsidered closed and the session is closed and correct. 35127222Sgreen 36127222Sgreen=item SSL_RECEIVED_SHUTDOWN 37127222Sgreen 38119166SmtmA shutdown alert was received form the peer, either a normal "close notify" 39119166Smtmor a fatal error. 40119166Smtm 41119166Smtm=back 42114769Sdougb 43114769SdougbSSL_SENT_SHUTDOWN and SSL_RECEIVED_SHUTDOWN can be set at the same time. 44114769Sdougb 45114769SdougbThe shutdown state of the connection is used to determine the state of 46154637Smatteothe ssl session. If the session is still open, when 47114769SdougbL<SSL_clear(3)|SSL_clear(3)> or L<SSL_free(3)|SSL_free(3)> is called, 48154637Smatteoit is considered bad and removed according to RFC2246. 49202880SkibThe actual condition for a correctly closed session is SSL_SENT_SHUTDOWN. 50154637SmatteoSSL_set_shutdown() can be used to set this state without sending a 51154637Smatteoclose alert to the peer (see L<SSL_shutdown(3)|SSL_shutdown(3)>). 52154637Smatteo 53114769SdougbIf a "close notify" was received, SSL_RECEIVED_SHUTDOWN will be set, 54154637Smatteofor setting SSL_SENT_SHUTDOWN the application must however still call 55154637SmatteoL<SSL_shutdown(3)|SSL_shutdown(3)> or SSL_set_shutdown() itself. 56154637Smatteo 57154637Smatteo=head1 RETURN VALUES 58154637Smatteo 59114769SdougbSSL_set_shutdown() does not return diagnostic information. 60154637Smatteo 61154637SmatteoSSL_get_shutdown() returns the current setting. 62154637Smatteo 63154637Smatteo=head1 SEE ALSO 64154637Smatteo 65114769SdougbL<ssl(3)|ssl(3)>, L<SSL_shutdown(3)|SSL_shutdown(3)>, 66114769SdougbL<SSL_clear(3)|SSL_clear(3)>, L<SSL_free(3)|SSL_free(3)> 67114769Sdougb 68114769Sdougb=cut 69114769Sdougb