]> git.ipfire.org Git - thirdparty/openssl.git/blame - doc/man3/SSL_set_shutdown.pod
Deprecate the low level Diffie-Hellman functions.
[thirdparty/openssl.git] / doc / man3 / SSL_set_shutdown.pod
CommitLineData
8e495e4a
LJ
1=pod
2
3=head1 NAME
4
5SSL_set_shutdown, SSL_get_shutdown - manipulate shutdown state of an SSL connection
6
7=head1 SYNOPSIS
8
9 #include <openssl/ssl.h>
10
11 void SSL_set_shutdown(SSL *ssl, int mode);
12
c3e64028 13 int SSL_get_shutdown(const SSL *ssl);
8e495e4a
LJ
14
15=head1 DESCRIPTION
16
17SSL_set_shutdown() sets the shutdown state of B<ssl> to B<mode>.
18
19SSL_get_shutdown() returns the shutdown mode of B<ssl>.
20
21=head1 NOTES
22
9c0586d5 23The shutdown state of an ssl connection is a bit-mask of:
8e495e4a
LJ
24
25=over 4
26
e547c45f 27=item Z<>0
8e495e4a
LJ
28
29No shutdown setting, yet.
30
31=item SSL_SENT_SHUTDOWN
32
8e593f0a 33A close_notify shutdown alert was sent to the peer, the connection is being
8e495e4a
LJ
34considered closed and the session is closed and correct.
35
36=item SSL_RECEIVED_SHUTDOWN
37
8e593f0a 38A shutdown alert was received form the peer, either a normal close_notify
8e495e4a
LJ
39or a fatal error.
40
41=back
42
43SSL_SENT_SHUTDOWN and SSL_RECEIVED_SHUTDOWN can be set at the same time.
44
45The shutdown state of the connection is used to determine the state of
46the ssl session. If the session is still open, when
9b86974e 47L<SSL_clear(3)> or L<SSL_free(3)> is called,
8e495e4a 48it is considered bad and removed according to RFC2246.
d93eb21c 49The actual condition for a correctly closed session is SSL_SENT_SHUTDOWN
8e593f0a 50(according to the TLS RFC, it is acceptable to only send the close_notify
d93eb21c
LJ
51alert but to not wait for the peer's answer, when the underlying connection
52is closed).
8e495e4a 53SSL_set_shutdown() can be used to set this state without sending a
9b86974e 54close alert to the peer (see L<SSL_shutdown(3)>).
8e495e4a 55
8e593f0a 56If a close_notify was received, SSL_RECEIVED_SHUTDOWN will be set,
8e495e4a 57for setting SSL_SENT_SHUTDOWN the application must however still call
9b86974e 58L<SSL_shutdown(3)> or SSL_set_shutdown() itself.
8e495e4a
LJ
59
60=head1 RETURN VALUES
61
62SSL_set_shutdown() does not return diagnostic information.
63
64SSL_get_shutdown() returns the current setting.
65
66=head1 SEE ALSO
67
b97fdb57 68L<ssl(7)>, L<SSL_shutdown(3)>,
9b86974e
RS
69L<SSL_CTX_set_quiet_shutdown(3)>,
70L<SSL_clear(3)>, L<SSL_free(3)>
8e495e4a 71
e2f92610
RS
72=head1 COPYRIGHT
73
c486283c 74Copyright 2001-2018 The OpenSSL Project Authors. All Rights Reserved.
e2f92610 75
4746f25a 76Licensed under the Apache License 2.0 (the "License"). You may not use
e2f92610
RS
77this file except in compliance with the License. You can obtain a copy
78in the file LICENSE in the source distribution or at
79L<https://www.openssl.org/source/license.html>.
80
81=cut