1*4724848cSchristos=pod 2*4724848cSchristos 3*4724848cSchristos=head1 NAME 4*4724848cSchristos 5*4724848cSchristosSSL_set_shutdown, SSL_get_shutdown - manipulate shutdown state of an SSL connection 6*4724848cSchristos 7*4724848cSchristos=head1 SYNOPSIS 8*4724848cSchristos 9*4724848cSchristos #include <openssl/ssl.h> 10*4724848cSchristos 11*4724848cSchristos void SSL_set_shutdown(SSL *ssl, int mode); 12*4724848cSchristos 13*4724848cSchristos int SSL_get_shutdown(const SSL *ssl); 14*4724848cSchristos 15*4724848cSchristos=head1 DESCRIPTION 16*4724848cSchristos 17*4724848cSchristosSSL_set_shutdown() sets the shutdown state of B<ssl> to B<mode>. 18*4724848cSchristos 19*4724848cSchristosSSL_get_shutdown() returns the shutdown mode of B<ssl>. 20*4724848cSchristos 21*4724848cSchristos=head1 NOTES 22*4724848cSchristos 23*4724848cSchristosThe shutdown state of an ssl connection is a bit mask of: 24*4724848cSchristos 25*4724848cSchristos=over 4 26*4724848cSchristos 27*4724848cSchristos=item Z<>0 28*4724848cSchristos 29*4724848cSchristosNo shutdown setting, yet. 30*4724848cSchristos 31*4724848cSchristos=item SSL_SENT_SHUTDOWN 32*4724848cSchristos 33*4724848cSchristosA close_notify shutdown alert was sent to the peer, the connection is being 34*4724848cSchristosconsidered closed and the session is closed and correct. 35*4724848cSchristos 36*4724848cSchristos=item SSL_RECEIVED_SHUTDOWN 37*4724848cSchristos 38*4724848cSchristosA shutdown alert was received form the peer, either a normal close_notify 39*4724848cSchristosor a fatal error. 40*4724848cSchristos 41*4724848cSchristos=back 42*4724848cSchristos 43*4724848cSchristosSSL_SENT_SHUTDOWN and SSL_RECEIVED_SHUTDOWN can be set at the same time. 44*4724848cSchristos 45*4724848cSchristosThe shutdown state of the connection is used to determine the state of 46*4724848cSchristosthe ssl session. If the session is still open, when 47*4724848cSchristosL<SSL_clear(3)> or L<SSL_free(3)> is called, 48*4724848cSchristosit is considered bad and removed according to RFC2246. 49*4724848cSchristosThe actual condition for a correctly closed session is SSL_SENT_SHUTDOWN 50*4724848cSchristos(according to the TLS RFC, it is acceptable to only send the close_notify 51*4724848cSchristosalert but to not wait for the peer's answer, when the underlying connection 52*4724848cSchristosis closed). 53*4724848cSchristosSSL_set_shutdown() can be used to set this state without sending a 54*4724848cSchristosclose alert to the peer (see L<SSL_shutdown(3)>). 55*4724848cSchristos 56*4724848cSchristosIf a close_notify was received, SSL_RECEIVED_SHUTDOWN will be set, 57*4724848cSchristosfor setting SSL_SENT_SHUTDOWN the application must however still call 58*4724848cSchristosL<SSL_shutdown(3)> or SSL_set_shutdown() itself. 59*4724848cSchristos 60*4724848cSchristos=head1 RETURN VALUES 61*4724848cSchristos 62*4724848cSchristosSSL_set_shutdown() does not return diagnostic information. 63*4724848cSchristos 64*4724848cSchristosSSL_get_shutdown() returns the current setting. 65*4724848cSchristos 66*4724848cSchristos=head1 SEE ALSO 67*4724848cSchristos 68*4724848cSchristosL<ssl(7)>, L<SSL_shutdown(3)>, 69*4724848cSchristosL<SSL_CTX_set_quiet_shutdown(3)>, 70*4724848cSchristosL<SSL_clear(3)>, L<SSL_free(3)> 71*4724848cSchristos 72*4724848cSchristos=head1 COPYRIGHT 73*4724848cSchristos 74*4724848cSchristosCopyright 2001-2020 The OpenSSL Project Authors. All Rights Reserved. 75*4724848cSchristos 76*4724848cSchristosLicensed under the OpenSSL license (the "License"). You may not use 77*4724848cSchristosthis file except in compliance with the License. You can obtain a copy 78*4724848cSchristosin the file LICENSE in the source distribution or at 79*4724848cSchristosL<https://www.openssl.org/source/license.html>. 80*4724848cSchristos 81*4724848cSchristos=cut 82