SSL_IN_INIT(3ossl)
π SSL_IN_INIT π (the OpenSSL manual page, bestie edition)
okay so this is the page from the OpenSSL manual set, and it's all about peeking inside the handshake state machine to see what it's doing. yes, the TLS handshake has lore, and this page is the lore dump. no cap. πΈ
β¨ NAME β¨
SSL_in_before, SSL_in_init, SSL_is_init_finished, SSL_in_connect_init, SSL_in_accept_init, SSL_get_state β these are the little detectives π that tell you stuff about the handshake state machine. honestly iconic behavior.
π¦ SYNOPSIS π¦
#include <openssl/ssl.h>
int SSL_in_init(const SSL *s);
int SSL_in_before(const SSL *s);
int SSL_is_init_finished(const SSL *s);
int SSL_in_connect_init(SSL *s);
int SSL_in_accept_init(SSL *s);
OSSL_HANDSHAKE_STATE SSL_get_state(const SSL *ssl);
like, look at them all lined up. so organized. π
π DESCRIPTION π
SSL_in_init()β returns1if the SSL/TLS state machine is currently processing or awaiting handshake messages, otherwise0. it's in its handshake era.SSL_in_before()β returns1if no SSL/TLS handshake has yet been initiated, otherwise0. this is the pre-handshake vibe. nothing has started yet, it's just standing there looking cute.SSL_is_init_finished()β returns1if the SSL/TLS connection is in a state where fully protected application data can be transferred, otherwise0. this is the "we made it, we're so back" state. π«Ά
β οΈ okay so heads up bestie: in some circumstances (such as when early data is being transferred)SSL_in_init(),SSL_in_before()andSSL_is_init_finished()can all return0. like, all three at once. not a girlboss moment, just how it is. don't panic.
π¨sMUST NOT beNULL. literally do not do that to me.
SSL_in_connect_init()β returns1ifsis acting as a client andSSL_in_init()would return1. otherwise0. client-side handshake energy only.SSL_in_accept_init()β returns1ifsis acting as a server andSSL_in_init()would return1. otherwise0. server-side handshake energy only.
π‘ lowkey important:SSL_in_connect_init()andSSL_in_accept_init()are implemented as macros. so like, they're not real functions. it's giving "we're built different."
SSL_get_state()β returns a value indicating the current state of the handshake state machine.OSSL_HANDSHAKE_STATEis an enumerated type where each value indicates a discrete state machine state. π―
π future versions of OpenSSL may define more states, so applications should expect to receive unrecognised state values. like, just be ready for strangers. be chill about it.
the naming format is made up of a number of elements, and it goes like this:
protocol_ST_role_message
let me break that down for you, gorgeous:
protocolβ one ofTLSorDTLS.DTLSis used where a state is specific to the DTLS protocol. otherwise<rainbow>TLS</rainbow>is used.roleβ one ofCR,CW,SRorSWto indicate "client reading", "client writing", "server reading" or "server writing" respectively. cute little abbreviations, obsessed.messageβ the name of a handshake message that is being or has been sent, or is being or has been processed.
π the special states π
additionally there are some special states that do not conform to the above format. they're the main characters. they are:
TLS_ST_BEFOREβ no handshake messages have yet been been sent or received. (yes the original says "been been", i'm keeping it. character for character, bestie. π)TLS_ST_OKβ handshake message sending/processing has completed. we love a finished queen.TLS_ST_EARLY_DATAβ early data is being processedTLS_ST_PENDING_EARLY_DATA_ENDβ awaiting the end of early data processing
π RETURN VALUES π
SSL_in_init(),SSL_in_before(),SSL_is_init_finished(),SSL_in_connect_init()andSSL_in_accept_init()β return values as indicated above. (scroll up, i literally just told you π)SSL_get_state()β returns the current handshake state.
π SEE ALSO π
go read those too, i believe in you. πβ¨
π COPYRIGHT π
Copyright 2017-2018 The OpenSSL Project Authors. All Rights Reserved.
Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at <https://www.openssl.org/source/license.html>.
like fr fr, read the license, it's giving legal slay. βοΈπ
and that's the whole page, bestie!! shipped to you from OpenSSL 3.5.6, dated 2026-04-07 β that's the SSL_IN_INIT(3ossl) page, and you ate it up. periodt. πβ¨π
π¦ where this page comes from
- freebsd 15.1: base 15.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms