11 - retrieve information about the handshake state machine
15 #include <openssl/ssl.h>
17 int SSL_in_init(const SSL *s);
18 int SSL_in_before(const SSL *s);
19 int SSL_is_init_finished(const SSL *s);
21 int SSL_in_connect_init(SSL *s);
22 int SSL_in_accept_init(SSL *s);
24 OSSL_HANDSHAKE_STATE SSL_get_state(const SSL *ssl);
28 SSL_in_init() returns 1 if the SSL/TLS state machine is currently processing or
29 awaiting handshake messages, or 0 otherwise.
31 SSL_in_before() returns 1 if no SSL/TLS handshake has yet been initiated, or 0
34 SSL_is_init_finished() returns 1 if the SSL/TLS connection is in a state where
35 fully protected application data can be transferred or 0 otherwise.
37 Note that in some circumstances (such as when early data is being transferred)
38 SSL_in_init(), SSL_in_before() and SSL_is_init_finished() can all return 0.
40 SSL_in_connect_init() returns 1 if B<s> is acting as a client and SSL_in_init()
41 would return 1, or 0 otherwise.
43 SSL_in_accept_init() returns 1 if B<s> is acting as a server and SSL_in_init()
44 would return 1, or 0 otherwise.
46 SSL_in_connect_init() and SSL_in_accept_init() are implemented as macros.
48 SSL_get_state() returns a value indicating the current state of the handshake
49 state machine. OSSL_HANDSHAKE_STATE is an enumerated type where each value
50 indicates a discrete state machine state. Note that future versions of OpenSSL
51 may define more states so applications should expect to receive unrecognised
52 state values. The naming format is made up of a number of elements as follows:
54 B<protocol>_ST_B<role>_B<message>
56 B<protocol> is one of TLS or DTLS. DTLS is used where a state is specific to the
57 DTLS protocol. Otherwise TLS is used.
59 B<role> is one of CR, CW, SR or SW to indicate "client reading",
60 "client writing", "server reading" or "server writing" respectively.
62 B<message> is the name of a handshake message that is being or has been sent, or
63 is being or has been processed.
65 Additionally there are some special states that do not conform to the above
72 No handshake messages have yet been been sent or received.
76 Handshake message sending/processing has completed.
78 =item TLS_ST_EARLY_DATA
80 Early data is being processed
82 =item TLS_ST_PENDING_EARLY_DATA_END
84 Awaiting the end of early data processing
90 SSL_in_init(), SSL_in_before(), SSL_is_init_finished(), SSL_in_connect_init()
91 and SSL_in_accept_init() return values as indicated above.
93 SSL_get_state() returns the current handshake state.
99 L<SSL_read_early_data(3)>
103 Copyright 2017-2018 The OpenSSL Project Authors. All Rights Reserved.
105 Licensed under the Apache License 2.0 (the "License"). You may not use
106 this file except in compliance with the License. You can obtain a copy
107 in the file LICENSE in the source distribution or at
108 L<https://www.openssl.org/source/license.html>.