SSL_GET_STREAM_ID(3ossl)

πŸ“¦ version 3.5.0, in opensuse-leap 16.0

πŸ’… SSL_GET_STREAM_ID β€” the 3ossl glow-up πŸ’…

okay so this is the 3ossl manual page for SSL_get_stream_id and the whole stream-type girlie squad 🫢 and honestly? it's way less scary than it looks. let's get into it ✨


🌸 NAME 🌸

SSL_get_stream_id, SSL_get_stream_type, SSL_STREAM_TYPE_NONE, SSL_STREAM_TYPE_READ, SSL_STREAM_TYPE_WRITE, SSL_STREAM_TYPE_BIDI, SSL_is_stream_local β€” literally the whole function family that gets you QUIC stream ID and stream type info πŸ’–


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <openssl/ssl.h>

uint64_t SSL_get_stream_id(SSL *ssl);

#define SSL_STREAM_TYPE_NONE
#define SSL_STREAM_TYPE_BIDI
#define SSL_STREAM_TYPE_READ
#define SSL_STREAM_TYPE_WRITE
int SSL_get_stream_type(SSL *ssl);

int SSL_is_stream_local(SSL *ssl);

like, that's it. that's the whole vibe check πŸ‘‘


✨ DESCRIPTION ✨

πŸŽ€ SSL_get_stream_id()

she returns the QUIC stream ID for a QUIC stream SSL object β€” OR for a QUIC connection SSL object that has a default stream attached. either way, you get your ID πŸ’…

πŸŽ€ SSL_get_stream_type()

this one tells you what operations you can actually do on the stream, and she returns one of these bad girls:

  • SSL_STREAM_TYPE_NONE β€” the SSL object is a QUIC connection SSL object with no default stream attached. it's giving "empty inbox" energy 😭
  • SSL_STREAM_TYPE_BIDI β€” the SSL object is a non-QUIC SSL object, OR it's a QUIC stream object (or a QUIC connection SSL object with a default stream attached) and that stream is a bidirectional QUIC stream. two-way street, main character energy 🌈
  • SSL_STREAM_TYPE_READ β€” the SSL object is a QUIC stream object (or a QUIC connection SSL object with a default stream attached), and that stream is a unidirectional QUIC stream that was initiated by the remote peer. so: you can read from it, but you cannot write to it. read-only bestie, no replying πŸ™ˆ
  • SSL_STREAM_TYPE_WRITE β€” the SSL object is a QUIC stream object (or a QUIC connection SSL object with a default stream attached), and that stream is a unidirectional QUIC stream initiated by the local application. so: you can write to it, but you cannot read from it. you're the talker, not the listener πŸ’¬

πŸŽ€ SSL_is_stream_local()

determines whether a stream was created locally. simple as that, no cap 🧚


⭐ NOTES ⭐

okay bestie, listen, this part is important πŸ‘€

QUICv1 assigns specific meaning to the low two bits of a QUIC stream ID β€” but QUIC stream IDs in future versions of QUIC are not required to have the same semantics. so do not determine stream properties using these bits πŸ’€ instead, use SSL_get_stream_type() to figure out the stream type, and SSL_get_stream_is_local() to figure out the stream initiator. periodt.

also! SSL_get_stream_type() identifies the type of a QUIC stream based on its identity, and it does not tell you whether an operation can currently be successfully performed on a stream. like, example: you might locally initiate a unidirectional stream, write to it, and then conclude the stream using SSL_stream_conclude(3) β€” meaning it can no longer be written to β€” but SSL_get_stream_type() would still return SSL_STREAM_TYPE_WRITE. she's not lying, she's just answering a different question πŸ’β€β™€οΈ the value returned by SSL_get_stream_type() does not vary over the lifespan of a stream. iconic, consistent, unbothered πŸ‘‘


πŸ”₯ RETURN VALUES πŸ”₯

  • SSL_get_stream_id() β€” returns a QUIC stream ID, or UINT64_MAX if you call it on an SSL object that isn't a QUIC SSL object, or if you call it on a QUIC connection SSL object without a default stream attached. πŸ“Œ note that valid QUIC stream IDs are always below 2**62.
  • SSL_get_stream_type() β€” returns one of the SSL_STREAM_TYPE values. slay.
  • SSL_is_stream_local() β€” returns 1 if called on a QUIC stream SSL object representing a stream that was locally initiated. returns 0 if called on a QUIC stream SSL object representing a stream that was remotely initiated by a peer. and returns -1 if called on any other kind of SSL object. three moods, one function 🎭

🌈 SEE ALSO 🌈

SSL_new_stream(3), SSL_accept_stream(3) β€” go read these next, i'm obsessed with them 🫢


πŸ’œ HISTORY πŸ’œ

these functions were added in OpenSSL 3.2. so if you're on something older, that's why she's not answering your texts 😭


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>.

and that's the whole page, bestie πŸ’– this was version 3.5.0, dated 2026-09-25, page SSL_GET_STREAM_ID(3ossl) β€” go forth and stream responsibly βœ¨πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from