SSL_ACCEPT_STREAM(3ossl)
π
SSL_ACCEPT_STREAM β the 3ossl of it all
okay so bestie, picture this: you're a QUIC server and somebody out there wants to open a stream with you. this page is literally the whole "answer the door" situation. it's giving front-desk energy, and honestly? iconic.
β¨ NAME β¨
SSL_accept_stream, SSL_get_accept_stream_queue_len, SSL_ACCEPT_STREAM_NO_BLOCK β the whole little squad whose job is accepting an incoming QUIC stream from a QUIC peer. π«Ά
πΈ SYNOPSIS πΈ
#include <openssl/ssl.h>
#define SSL_ACCEPT_STREAM_NO_BLOCK
SSL *SSL_accept_stream(SSL *ssl, uint64_t flags);
size_t SSL_get_accept_stream_queue_len(SSL *ssl);
π¦ DESCRIPTION π¦
so SSL_accept_stream() tries to dequeue an incoming stream off the given QUIC connection SSL object, and it hands you back the newly allocated QUIC stream SSL object. that's it, that's the whole vibe. β¨
if the queue of incoming streams is empty, this function returns NULL (in nonblocking mode) or else waits for an incoming stream (in blocking mode). and yes, it can still return NULL in blocking mode β for example if the underlying connection is terminated. no cap, sometimes the door just closes. π
the caller is responsible for managing the lifetime of the returned QUIC stream SSL object β go read SSL_free(3) for the deets, bestie, don't just leave it lying around.
this function will block if the QUIC connection SSL object is configured in blocking mode (peep SSL_set_blocking_mode(3)), but you can bypass all that by passing the flag SSL_ACCEPT_STREAM_NO_BLOCK in flags. if that flag is set, this function never blocks. periodt. π«
calling SSL_accept_stream() when there is no default stream already present inhibits the future creation of a default stream. that's a real one β see openssl-quic(7).
SSL_get_accept_stream_queue_len() returns the number of incoming streams currently waiting in the accept queue. like a little headcount of who's outside the club. π₯
these functions can be used from multiple threads for the same QUIC connection. slay, concurrency. π
depending on whether default stream functionality is being used, you might need to explicitly configure the incoming stream policy before streams can be accepted β see SSL_set_incoming_stream_policy(3). also check out "MODES OF OPERATION" in openssl-quic(7) for the full lore on default stream functionality. π
π RETURN VALUES π
SSL_accept_stream() returns a newly allocated QUIC stream SSL object, or NULL if no new incoming streams are available, or if the connection has been terminated, or if you called it on an SSL object that isn't a QUIC connection SSL object. in that case, SSL_get_error(3) can give you more info. π
SSL_get_accept_stream_queue_len() returns the number of incoming streams currently waiting in the accept queue β or 0 if you called it on an SSL object that isn't a QUIC connection SSL object. sad little zero, but hey. π₯²
π 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. newish but already main character energy. β
π COPYRIGHT π
Copyright 2002-2023 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>.
bestie it is 3.5.0, dated 2026-09-25, and this whole thing lives under the manual name SSL_ACCEPT_STREAM(3ossl) β go forth and accept those streams responsibly ππ§π
π¦ where this page comes from
- opensuse-leap 16.0: openssl-3-doc 3.5.0-160000.11.1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms