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 bitmask 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
28 connection is being considered closed and the session is closed and
29 correct.
30
31 SSL_RECEIVED_SHUTDOWN
32 A shutdown alert was received form the peer, either a normal "close
33 notify" or a fatal error.
34
35 SSL_SENT_SHUTDOWN and SSL_RECEIVED_SHUTDOWN can be set at the same
36 time.
37
38 The shutdown state of the connection is used to determine the state of
39 the ssl session. If the session is still open, when SSL_clear(3) or
40 SSL_free(3) is called, it is considered bad and removed according to
41 RFC2246. The actual condition for a correctly closed session is
42 SSL_SENT_SHUTDOWN (according to the TLS RFC, it is acceptable to only
43 send the "close notify" alert but to not wait for the peer's answer,
44 when the underlying connection is closed). SSL_set_shutdown() can be
45 used to set this state without sending a close alert to the peer (see
46 SSL_shutdown(3)).
47
48 If a "close notify" was received, SSL_RECEIVED_SHUTDOWN will be set,
49 for setting SSL_SENT_SHUTDOWN the application must however still call
50 SSL_shutdown(3) or SSL_set_shutdown() itself.
51
53 SSL_set_shutdown() does not return diagnostic information.
54
55 SSL_get_shutdown() returns the current setting.
56
58 ssl(3), SSL_shutdown(3), SSL_CTX_set_quiet_shutdown(3), SSL_clear(3),
59 SSL_free(3)
60
61
62
631.0.2o 2019-09-10 SSL_set_shutdown(3)