SSL_ACCEPT(3ossl)
πΈ NAME πΈ
SSL_accept β wait for a TLS/SSL client to initiate a TLS/SSL handshake. This is the 3ossl manual page, bestie, and yes it's literally all about that accept life π
β¨ SYNOPSIS β¨
#include <openssl/ssl.h>
int SSL_accept(SSL *ssl);
π¦ DESCRIPTION π¦
So SSL_accept() waits for a TLS/SSL client to initiate the TLS/SSL handshake. Periodt. The communication channel must already have been set and assigned to the ssl by setting an underlying BIO β like, that part is not optional, bestie π«Ά
π NOTES π
The behaviour of SSL_accept() depends on the underlying BIO. This is the main character detail, fr fr.
If the underlying BIO is blocking, SSL_accept() will only return once the handshake has been finished or an error occurred. No in-between, no little peek, just wait and see π
If the underlying BIO is nonblocking, SSL_accept() will also return when the underlying BIO could not satisfy the needs of SSL_accept() to continue the handshake, indicating the problem by the return value -1. In this case a call to SSL_get_error() with the return value of SSL_accept() will yield SSL_ERROR_WANT_READ or SSL_ERROR_WANT_WRITE. The calling process then must repeat the call after taking appropriate action to satisfy the needs of SSL_accept(). The action depends on the underlying BIO. When using a nonblocking socket, nothing is to be done, but select() 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. That's the whole vibe check π₯
π RETURN VALUES π
The following return values can occur:
0β The TLS/SSL handshake was not successful but was shut down controlled and by the specifications of the TLS/SSL protocol. CallSSL_get_error()with the return valueretto find out the reason.1β The TLS/SSL handshake was successfully completed, 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 if action is needed to continue the operation for nonblocking BIOs. CallSSL_get_error()with the return valueretto find out the reason.
π SEE ALSO π
SSL_get_error(3), SSL_connect(3), SSL_shutdown(3), ssl(7), bio(7), SSL_set_connect_state(3), SSL_do_handshake(3), SSL_CTX_new(3)
π COPYRIGHT π
Copyright 2000-2020 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>.
Okay bestie, that's the whole page. This iconic little number is from version 3.5.6, dated 2026-04-07, and it lives under the manual name SSL_ACCEPT(3ossl). Go forth and handshake responsibly π§π
π¦ 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