SSL_ACCEPT_STREAM(3SSL)
πΈ SSL_ACCEPT_STREAM π β OpenSSL
okay so bestie, this is the OpenSSL page for the QUIC stream-accepting girlies β¨ it lives in section 3SSL and it's literally all about pulling incoming QUIC streams off the queue. no cap, let's get into it π«Ά
β¨ NAME β¨
SSL_accept_stream, SSL_get_accept_stream_queue_len, SSL_ACCEPT_STREAM_NO_BLOCK, SSL_ACCEPT_STREAM_UNI, SSL_ACCEPT_STREAM_BIDI β accept an incoming QUIC stream from a QUIC peer</p> π¦
π SYNOPSIS π
#include <openssl/ssl.h>
#define SSL_ACCEPT_STREAM_NO_BLOCK
#define SSL_ACCEPT_STREAM_UNI
#define SSL_ACCEPT_STREAM_BIDI
SSL *SSL_accept_stream(SSL *ssl, uint64_t flags);
size_t SSL_get_accept_stream_queue_len(SSL *ssl);
π DESCRIPTION π
okay so. SSL_accept_stream() tries to dequeue an incoming stream from the QUIC connection SSL object you hand it, and it returns the brand-new, freshly allocated QUIC stream SSL object. it's giving β¨manifesting a streamβ¨.
if the queue of incoming streams is empty, this function returns NULL (in nonblocking mode) or it waits for an incoming stream to show up (in blocking mode). and yeah, it can still return NULL in blocking mode too β like, for example if the underlying connection got terminated π the vibe check failed, it's over.
the caller is fully responsible for managing the lifetime of the returned QUIC stream SSL object. the returned object is yours now, bestie β for more info, see SSL_free(3) π
this function will block if the QUIC connection SSL object is configured in blocking mode (see SSL_set_blocking_mode(3)), but you can bypass that whole situation by passing the flag SSL_ACCEPT_STREAM_NO_BLOCK in flags. if this flag is set, this function never blocks, periodt.
by default, this function returns the first incoming stream, whether it's unidirectional or bidirectional β she doesn't judge, she accepts all types π«Ά. passing the flag SSL_ACCEPT_STREAM_UNI or SSL_ACCEPT_STREAM_BIDI will return the first stream that is unidirectional or bidirectional, respectively. if these flags are both set, either type can be returned, so it's a surprise and honestly iconic π. a NULL return value may mean that there are still streams that can be dequeued β so like, NULL doesn't always mean the queue is empty, iykyk.
calling SSL_accept_stream() if there is no default stream already present inhibits the future creation of a default stream. yes that's a real consequence. see openssl-quic(7) π
SSL_get_accept_stream_queue_len() returns the number of incoming streams currently waiting in the accept queue. literally just a headcount of who's waiting in line π§
these functions can be used from multiple threads for the same QUIC connection. slay, thread-safe bestie.
depending on whether default stream functionality is being used, it may be necessary to explicitly configure the incoming stream policy before streams can be accepted; see SSL_set_incoming_stream_policy(3). see also "MODES OF OPERATION" in openssl-quic(7) for more info on default stream functionality β¨
β RETURN VALUES β
SSL_accept_stream()returns a newly allocated QUIC stream SSL object, orNULLif:- no new incoming streams are available π
- the connection has been terminated π
- or it was called on an SSL object that isn't a QUIC connection SSL object (wrong address girl, that's not the function's main character)
SSL_get_error(3)can be used to obtain further information in this case πSSL_get_accept_stream_queue_len()returns the number of incoming streams currently waiting in the accept queue, or0if called on an SSL object other than a QUIC connection SSL object.
π SEE ALSO π
"MODES OF OPERATION" in openssl-quic(7), SSL_new_stream(3), SSL_set_blocking_mode(3), SSL_free(3) π¦
π HISTORY π
SSL_accept_stream() and SSL_get_accept_stream_queue_len() were added in OpenSSL 3.2. glow-up era β¨
π COPYRIGHT π
Copyright 2002-2025 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, you ate it up fr fr π
β¨ this was SSL_accept_stream(3SSL) from the OpenSSL fam, version 4.0.3, dated 2026-09-29 β mwah, go accept some streams, love u π«ΆπΈ
π¦ where this page comes from
- ubuntu stonking: libssl-doc 4.0.3-1ubuntu1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms