| 1 |
.\" -*- mode: troff; coding: utf-8 -*- |
| 2 |
.\" Automatically generated by Pod::Man 5.0102 (Pod::Simple 3.45) |
| 3 |
.\" |
| 4 |
.\" Standard preamble: |
| 5 |
.\" ======================================================================== |
| 6 |
.de Sp \" Vertical space (when we can't use .PP) |
| 7 |
.if t .sp .5v |
| 8 |
.if n .sp |
| 9 |
.. |
| 10 |
.de Vb \" Begin verbatim text |
| 11 |
.ft CW |
| 12 |
.nf |
| 13 |
.ne \\$1 |
| 14 |
.. |
| 15 |
.de Ve \" End verbatim text |
| 16 |
.ft R |
| 17 |
.fi |
| 18 |
.. |
| 19 |
.\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. |
| 20 |
.ie n \{\ |
| 21 |
. ds C` "" |
| 22 |
. ds C' "" |
| 23 |
'br\} |
| 24 |
.el\{\ |
| 25 |
. ds C` |
| 26 |
. ds C' |
| 27 |
'br\} |
| 28 |
.\" |
| 29 |
.\" Escape single quotes in literal strings from groff's Unicode transform. |
| 30 |
.ie \n(.g .ds Aq \(aq |
| 31 |
.el .ds Aq ' |
| 32 |
.\" |
| 33 |
.\" If the F register is >0, we'll generate index entries on stderr for |
| 34 |
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index |
| 35 |
.\" entries marked with X<> in POD. Of course, you'll have to process the |
| 36 |
.\" output yourself in some meaningful fashion. |
| 37 |
.\" |
| 38 |
.\" Avoid warning from groff about undefined register 'F'. |
| 39 |
.de IX |
| 40 |
.. |
| 41 |
.nr rF 0 |
| 42 |
.if \n(.g .if rF .nr rF 1 |
| 43 |
.if (\n(rF:(\n(.g==0)) \{\ |
| 44 |
. if \nF \{\ |
| 45 |
. de IX |
| 46 |
. tm Index:\\$1\t\\n%\t"\\$2" |
| 47 |
.. |
| 48 |
. if !\nF==2 \{\ |
| 49 |
. nr % 0 |
| 50 |
. nr F 2 |
| 51 |
. \} |
| 52 |
. \} |
| 53 |
.\} |
| 54 |
.rr rF |
| 55 |
.\" ======================================================================== |
| 56 |
.\" |
| 57 |
.IX Title "SSL_IN_INIT 3SSL" |
| 58 |
.TH SSL_IN_INIT 3SSL 2026-04-07 3.6.2 OpenSSL |
| 59 |
.\" For nroff, turn off justification. Always turn off hyphenation; it makes |
| 60 |
.\" way too many mistakes in technical documents. |
| 61 |
.if n .ad l |
| 62 |
.nh |
| 63 |
.SH NAME |
| 64 |
SSL_in_before, |
| 65 |
SSL_in_init, |
| 66 |
SSL_is_init_finished, |
| 67 |
SSL_in_connect_init, |
| 68 |
SSL_in_accept_init, |
| 69 |
SSL_get_state |
| 70 |
\&\- retrieve information about the handshake state machine |
| 71 |
.SH SYNOPSIS |
| 72 |
.IX Header "SYNOPSIS" |
| 73 |
.Vb 1 |
| 74 |
\& #include <openssl/ssl.h> |
| 75 |
\& |
| 76 |
\& int SSL_in_init(const SSL *s); |
| 77 |
\& int SSL_in_before(const SSL *s); |
| 78 |
\& int SSL_is_init_finished(const SSL *s); |
| 79 |
\& |
| 80 |
\& int SSL_in_connect_init(SSL *s); |
| 81 |
\& int SSL_in_accept_init(SSL *s); |
| 82 |
\& |
| 83 |
\& OSSL_HANDSHAKE_STATE SSL_get_state(const SSL *ssl); |
| 84 |
.Ve |
| 85 |
.SH DESCRIPTION |
| 86 |
.IX Header "DESCRIPTION" |
| 87 |
\&\fBSSL_in_init()\fR returns 1 if the SSL/TLS state machine is currently processing or |
| 88 |
awaiting handshake messages, or 0 otherwise. |
| 89 |
.PP |
| 90 |
\&\fBSSL_in_before()\fR returns 1 if no SSL/TLS handshake has yet been initiated, or 0 |
| 91 |
otherwise. |
| 92 |
.PP |
| 93 |
\&\fBSSL_is_init_finished()\fR returns 1 if the SSL/TLS connection is in a state where |
| 94 |
fully protected application data can be transferred or 0 otherwise. |
| 95 |
.PP |
| 96 |
Note that in some circumstances (such as when early data is being transferred) |
| 97 |
\&\fBSSL_in_init()\fR, \fBSSL_in_before()\fR and \fBSSL_is_init_finished()\fR can all return 0. |
| 98 |
.PP |
| 99 |
\&\fBs\fR \fBMUST NOT\fR be NULL. |
| 100 |
.PP |
| 101 |
\&\fBSSL_in_connect_init()\fR returns 1 if \fBs\fR is acting as a client and \fBSSL_in_init()\fR |
| 102 |
would return 1, or 0 otherwise. |
| 103 |
.PP |
| 104 |
\&\fBSSL_in_accept_init()\fR returns 1 if \fBs\fR is acting as a server and \fBSSL_in_init()\fR |
| 105 |
would return 1, or 0 otherwise. |
| 106 |
.PP |
| 107 |
\&\fBSSL_in_connect_init()\fR and \fBSSL_in_accept_init()\fR are implemented as macros. |
| 108 |
.PP |
| 109 |
\&\fBSSL_get_state()\fR returns a value indicating the current state of the handshake |
| 110 |
state machine. OSSL_HANDSHAKE_STATE is an enumerated type where each value |
| 111 |
indicates a discrete state machine state. Note that future versions of OpenSSL |
| 112 |
may define more states so applications should expect to receive unrecognised |
| 113 |
state values. The naming format is made up of a number of elements as follows: |
| 114 |
.PP |
| 115 |
\&\fBprotocol\fR_ST_\fBrole\fR_\fBmessage\fR |
| 116 |
.PP |
| 117 |
\&\fBprotocol\fR is one of TLS or DTLS. DTLS is used where a state is specific to the |
| 118 |
DTLS protocol. Otherwise TLS is used. |
| 119 |
.PP |
| 120 |
\&\fBrole\fR is one of CR, CW, SR or SW to indicate "client reading", |
| 121 |
"client writing", "server reading" or "server writing" respectively. |
| 122 |
.PP |
| 123 |
\&\fBmessage\fR is the name of a handshake message that is being or has been sent, or |
| 124 |
is being or has been processed. |
| 125 |
.PP |
| 126 |
Additionally there are some special states that do not conform to the above |
| 127 |
format. These are: |
| 128 |
.IP TLS_ST_BEFORE 4 |
| 129 |
.IX Item "TLS_ST_BEFORE" |
| 130 |
No handshake messages have yet been been sent or received. |
| 131 |
.IP TLS_ST_OK 4 |
| 132 |
.IX Item "TLS_ST_OK" |
| 133 |
Handshake message sending/processing has completed. |
| 134 |
.IP TLS_ST_EARLY_DATA 4 |
| 135 |
.IX Item "TLS_ST_EARLY_DATA" |
| 136 |
Early data is being processed |
| 137 |
.IP TLS_ST_PENDING_EARLY_DATA_END 4 |
| 138 |
.IX Item "TLS_ST_PENDING_EARLY_DATA_END" |
| 139 |
Awaiting the end of early data processing |
| 140 |
.SH "RETURN VALUES" |
| 141 |
.IX Header "RETURN VALUES" |
| 142 |
\&\fBSSL_in_init()\fR, \fBSSL_in_before()\fR, \fBSSL_is_init_finished()\fR, \fBSSL_in_connect_init()\fR |
| 143 |
and \fBSSL_in_accept_init()\fR return values as indicated above. |
| 144 |
.PP |
| 145 |
\&\fBSSL_get_state()\fR returns the current handshake state. |
| 146 |
.SH "SEE ALSO" |
| 147 |
.IX Header "SEE ALSO" |
| 148 |
\&\fBssl\fR\|(7), |
| 149 |
\&\fBSSL_read_early_data\fR\|(3) |
| 150 |
.SH COPYRIGHT |
| 151 |
.IX Header "COPYRIGHT" |
| 152 |
Copyright 2017\-2018 The OpenSSL Project Authors. All Rights Reserved. |
| 153 |
.PP |
| 154 |
Licensed under the Apache License 2.0 (the "License"). You may not use |
| 155 |
this file except in compliance with the License. You can obtain a copy |
| 156 |
in the file LICENSE in the source distribution or at |
| 157 |
<https://www.openssl.org/source/license.html>. |