xref: /minix3/crypto/external/bsd/openssl/dist/doc/ssl/SSL_set_shutdown.pod (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1ebfedea0SLionel Sambuc=pod
2ebfedea0SLionel Sambuc
3ebfedea0SLionel Sambuc=head1 NAME
4ebfedea0SLionel Sambuc
5ebfedea0SLionel SambucSSL_set_shutdown, SSL_get_shutdown - manipulate shutdown state of an SSL connection
6ebfedea0SLionel Sambuc
7ebfedea0SLionel Sambuc=head1 SYNOPSIS
8ebfedea0SLionel Sambuc
9ebfedea0SLionel Sambuc #include <openssl/ssl.h>
10ebfedea0SLionel Sambuc
11ebfedea0SLionel Sambuc void SSL_set_shutdown(SSL *ssl, int mode);
12ebfedea0SLionel Sambuc
13ebfedea0SLionel Sambuc int SSL_get_shutdown(const SSL *ssl);
14ebfedea0SLionel Sambuc
15ebfedea0SLionel Sambuc=head1 DESCRIPTION
16ebfedea0SLionel Sambuc
17ebfedea0SLionel SambucSSL_set_shutdown() sets the shutdown state of B<ssl> to B<mode>.
18ebfedea0SLionel Sambuc
19ebfedea0SLionel SambucSSL_get_shutdown() returns the shutdown mode of B<ssl>.
20ebfedea0SLionel Sambuc
21ebfedea0SLionel Sambuc=head1 NOTES
22ebfedea0SLionel Sambuc
23ebfedea0SLionel SambucThe shutdown state of an ssl connection is a bitmask of:
24ebfedea0SLionel Sambuc
25ebfedea0SLionel Sambuc=over 4
26ebfedea0SLionel Sambuc
27*0a6a1f1dSLionel Sambuc=item Z<>0
28ebfedea0SLionel Sambuc
29ebfedea0SLionel SambucNo shutdown setting, yet.
30ebfedea0SLionel Sambuc
31ebfedea0SLionel Sambuc=item SSL_SENT_SHUTDOWN
32ebfedea0SLionel Sambuc
33ebfedea0SLionel SambucA "close notify" shutdown alert was sent to the peer, the connection is being
34ebfedea0SLionel Sambucconsidered closed and the session is closed and correct.
35ebfedea0SLionel Sambuc
36ebfedea0SLionel Sambuc=item SSL_RECEIVED_SHUTDOWN
37ebfedea0SLionel Sambuc
38ebfedea0SLionel SambucA shutdown alert was received form the peer, either a normal "close notify"
39ebfedea0SLionel Sambucor a fatal error.
40ebfedea0SLionel Sambuc
41ebfedea0SLionel Sambuc=back
42ebfedea0SLionel Sambuc
43ebfedea0SLionel SambucSSL_SENT_SHUTDOWN and SSL_RECEIVED_SHUTDOWN can be set at the same time.
44ebfedea0SLionel Sambuc
45ebfedea0SLionel SambucThe shutdown state of the connection is used to determine the state of
46ebfedea0SLionel Sambucthe ssl session. If the session is still open, when
47ebfedea0SLionel SambucL<SSL_clear(3)|SSL_clear(3)> or L<SSL_free(3)|SSL_free(3)> is called,
48ebfedea0SLionel Sambucit is considered bad and removed according to RFC2246.
49ebfedea0SLionel SambucThe actual condition for a correctly closed session is SSL_SENT_SHUTDOWN
50ebfedea0SLionel Sambuc(according to the TLS RFC, it is acceptable to only send the "close notify"
51ebfedea0SLionel Sambucalert but to not wait for the peer's answer, when the underlying connection
52ebfedea0SLionel Sambucis closed).
53ebfedea0SLionel SambucSSL_set_shutdown() can be used to set this state without sending a
54ebfedea0SLionel Sambucclose alert to the peer (see L<SSL_shutdown(3)|SSL_shutdown(3)>).
55ebfedea0SLionel Sambuc
56ebfedea0SLionel SambucIf a "close notify" was received, SSL_RECEIVED_SHUTDOWN will be set,
57ebfedea0SLionel Sambucfor setting SSL_SENT_SHUTDOWN the application must however still call
58ebfedea0SLionel SambucL<SSL_shutdown(3)|SSL_shutdown(3)> or SSL_set_shutdown() itself.
59ebfedea0SLionel Sambuc
60ebfedea0SLionel Sambuc=head1 RETURN VALUES
61ebfedea0SLionel Sambuc
62ebfedea0SLionel SambucSSL_set_shutdown() does not return diagnostic information.
63ebfedea0SLionel Sambuc
64ebfedea0SLionel SambucSSL_get_shutdown() returns the current setting.
65ebfedea0SLionel Sambuc
66ebfedea0SLionel Sambuc=head1 SEE ALSO
67ebfedea0SLionel Sambuc
68ebfedea0SLionel SambucL<ssl(3)|ssl(3)>, L<SSL_shutdown(3)|SSL_shutdown(3)>,
69ebfedea0SLionel SambucL<SSL_CTX_set_quiet_shutdown(3)|SSL_CTX_set_quiet_shutdown(3)>,
70ebfedea0SLionel SambucL<SSL_clear(3)|SSL_clear(3)>, L<SSL_free(3)|SSL_free(3)>
71ebfedea0SLionel Sambuc
72ebfedea0SLionel Sambuc=cut
73