SSL_ACCEPT(3)
π
SSL_accept(3) β wait for a TLS/SSL client to initiate a TLS/SSL handshake π
okay so this page is straight out of the Library Functions Manual, and it is giving βserver-side waiting eraβ β¨. The function is SSL_accept(), and it is literally the move where you wait for a TLS/SSL client to initiate the TLS/SSL handshake. No cap.
β¨ NAME
SSL_accept β wait for a TLS/SSL client to initiate a TLS/SSL handshake π«Ά
πΈ SYNOPSIS
library βlibsslβ libcrypto #include <openssl/ssl.h>
int
SSL_accept(SSL *ssl);
π DESCRIPTION
okay bestie, here is the vibe: SSL_accept() waits for a TLS/SSL client to initiate the TLS/SSL handshake. But first β and this is important β the communication channel must already have been set and assigned to the ssl object by setting an underlying BIO. Like, you cannot just show up with no BIO and expect the handshake to slay. π
The behaviour of SSL_accept() depends on the underlying BIO.
- If the underlying BIO is blocking,
SSL_accept()will only return once the handshake has been finished or an error occurred. So it sits there, patient main character style, until something happens. β - If the underlying BIO is non-blocking,
SSL_accept()will also return when the underlying BIO could not satisfy the needs ofSSL_accept()to continue the handshake, indicating the problem by the return valueβ1. In this case a call toSSL_get_error(3)with the return value ofSSL_accept()will yieldSSL_ERROR_WANT_READorSSL_ERROR_WANT_WRITE. The calling process then must repeat the call after taking appropriate action to satisfy the needs ofSSL_accept(). The action depends on the underlying BIO. When using a non-blocking socket, nothing is to be done, butselect(2)can be used to check for the required condition. When using a buffering BIO, like a BIO pair, data must be written into or retrieved out of the BIO before being able to continue. π
π RETURN VALUES
The following return values can occur:
0β The TLS/SSL handshake was not successful, but it was shut down in a controlled way and by the specifications of the TLS/SSL protocol. CallSSL_get_error(3)with the return valueretto find out the reason. π«Ά1β The TLS/SSL handshake was successfully completed, and a TLS/SSL connection has been established. slay. π<0β The TLS/SSL handshake was not successful because a fatal error occurred either at the protocol level or a connection failure occurred. The shutdown was not clean. It can also occur of action is need to continue the operation for non-blocking BIOs. CallSSL_get_error(3)with the return valueretto find out the reason. π
π¦ SEE ALSO
go check these out too, bestie:
BIO_new(3)ssl(3)SSL_connect(3)SSL_CTX_new(3)SSL_do_handshake(3)SSL_get_error(3)SSL_set_connect_state(3)SSL_shutdown(3)
π HISTORY
SSL_accept() appeared in SSLeay 0.4 or earlier and has been available since OpenBSD 2.4. iconic longevity behaviour, honestly. π
later, bestie! π this page came from the Debian version dated June 8, 2025, and the footer says SSL_ACCEPT(3) β mwah! π
π¦ where this page comes from
- alpine 3.24: libressl-doc 4.3.1-r0 Β· custom
- arch rolling: libressl 4.4.0-1 Β· ISC AND custom:OpenSSL
- Copyright (c) 2000, 2001, 2002, 2003 The OpenSSL Project
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms