SSL_GET_STREAM_ID(3SSL)
π SSL_GET_STREAM_ID β the OpenSSL one, section 3SSL
okay bestie so this is SSL_GET_STREAM_ID(3SSL) from the OpenSSL manual, and it's literally all about peeking at QUIC stream IDs and figuring out what kind of stream you're holding π¦
β¨ 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 β get QUIC stream ID and stream type information. that's the whole vibe π
πΈ 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);
π DESCRIPTION π
okay so buckle up, there are three functions and a whole little family of constants here π
SSL_get_stream_id() hands you the QUIC stream ID for a QUIC stream SSL object. and like, it ALSO works if you pass it a QUIC connection SSL object that has a default stream attached. cute right? π
SSL_get_stream_type() is the one that tells you what you can actually do with this stream. it returns exactly one of these bad boys:
SSL_STREAM_TYPE_NONEβ bestie the SSL object is a QUIC connection SSL object with no default stream attached. that's it. nothing to see here πSSL_STREAM_TYPE_BIDIβ the SSL object is either 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. both directions, 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 like... you can read from it, but you cannot write to it. read-only era π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 that was initiated by the local application. so you can write to it, but you cannot read from it. write-only era β¨
and SSL_is_stream_local()? it tells you whether a stream was locally created. simple as that π«Ά
π NOTES π
lowkey important stuff incoming, pay attention bestie π
so QUICv1 does assign specific meaning to the low two bits of a QUIC stream ID. BUT β and this is the tea β 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. no cap. instead, use SSL_get_stream_type() to determine the stream type, and SSL_get_stream_is_local() to determine the stream initiator π
also, SSL_get_stream_type() identifies the type of a QUIC stream based on its identity, and it does not indicate whether an operation can currently be successfully performed on a stream. for example: you might locally initiate a unidirectional stream, write to it, and then conclude the stream using SSL_stream_conclude(3), meaning that it can no longer be written to β but SSL_get_stream_type() would still return SSL_STREAM_TYPE_WRITE. it's giving "the label is forever" π
the value returned by SSL_get_stream_type() does not vary over the lifespan of a stream.
π RETURN VALUES π
SSL_get_stream_id()returns a QUIC stream ID, orUINT64_MAXif you call it on an SSL object which is not a QUIC SSL object, or if you call it on a QUIC connection SSL object without a default stream attached. quick side note: valid QUIC stream IDs are always below2**62. βSSL_get_stream_type()returns one of theSSL_STREAM_TYPEvalues. that's the whole menu πSSL_is_stream_local()returns1if you call it on a QUIC stream SSL object which represents a stream which was locally initiated. it returns0if you call it on a QUIC stream SSL object which represents a stream which was remotely initiated by a peer, and-1if you call it on any other kind of SSL object. three possible answers, no in-between π¦
π SEE ALSO π
π HISTORY π
these functions were added in OpenSSL 3.2. new-ish, but iconic β¨
πΈ 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>.
fr fr read the license bestie, it's not optional and it's not a vibe check you want to fail π
and that's the page!! this was OpenSSL 4.0.3, dated 2026-09-29, and it's the SSL_GET_STREAM_ID(3SSL) manual. slay, go read your QUIC streams responsibly ππ
π¦ 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