1SSL_SET_SHUTDOWN(3) OpenSSL SSL_SET_SHUTDOWN(3)
2
3
4
6 SSL_set_shutdown, SSL_get_shutdown - manipulate shutdown state of an
7 SSL connection
8
10 #include <openssl/ssl.h>
11
12 void SSL_set_shutdown(SSL *ssl, int mode);
13
14 int SSL_get_shutdown(const SSL *ssl);
15
17 SSL_set_shutdown() sets the shutdown state of ssl to mode.
18
19 SSL_get_shutdown() returns the shutdown mode of ssl.
20
22 The shutdown state of an ssl connection is a bit mask of:
23
24 0 No shutdown setting, yet.
25
26 SSL_SENT_SHUTDOWN
27 A close_notify shutdown alert was sent to the peer, the connection
28 is being considered closed and the session is closed and correct.
29
30 SSL_RECEIVED_SHUTDOWN
31 A shutdown alert was received form the peer, either a normal
32 close_notify or a fatal error.
33
34 SSL_SENT_SHUTDOWN and SSL_RECEIVED_SHUTDOWN can be set at the same
35 time.
36
37 The shutdown state of the connection is used to determine the state of
38 the ssl session. If the session is still open, when SSL_clear(3) or
39 SSL_free(3) is called, it is considered bad and removed according to
40 RFC2246. The actual condition for a correctly closed session is
41 SSL_SENT_SHUTDOWN (according to the TLS RFC, it is acceptable to only
42 send the close_notify alert but to not wait for the peer's answer, when
43 the underlying connection is closed). SSL_set_shutdown() can be used
44 to set this state without sending a close alert to the peer (see
45 SSL_shutdown(3)).
46
47 If a close_notify was received, SSL_RECEIVED_SHUTDOWN will be set, for
48 setting SSL_SENT_SHUTDOWN the application must however still call
49 SSL_shutdown(3) or SSL_set_shutdown() itself.
50
52 SSL_set_shutdown() does not return diagnostic information.
53
54 SSL_get_shutdown() returns the current setting.
55
57 ssl(7), SSL_shutdown(3), SSL_CTX_set_quiet_shutdown(3), SSL_clear(3),
58 SSL_free(3)
59
61 Copyright 2001-2020 The OpenSSL Project Authors. All Rights Reserved.
62
63 Licensed under the OpenSSL license (the "License"). You may not use
64 this file except in compliance with the License. You can obtain a copy
65 in the file LICENSE in the source distribution or at
66 <https://www.openssl.org/source/license.html>.
67
68
69
701.1.1l 2021-09-15 SSL_SET_SHUTDOWN(3)