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, or NULL if:
    • 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, or 0 if 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 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