SSL_GET_STREAM_ID(3ossl)
π NAME π
ok so this is the SSL_GET_STREAM_ID(3ossl) page, and it's literally all about getting QUIC stream ID + stream type info, bestie. The whole squad here is: SSL_get_stream_id, SSL_get_stream_type, SSL_STREAM_TYPE_NONE, SSL_STREAM_TYPE_READ, SSL_STREAM_TYPE_WRITE, SSL_STREAM_TYPE_BIDI, and SSL_is_stream_local β they all do the "get QUIC stream ID and stream type information" thing together, no cap. β¨
π SYNOPSIS π
ok so you gotta pull in the header first, obviously:
#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 π¦
So like. SSL_get_stream_id() gives you the QUIC stream ID for a QUIC stream SSL object β or for a QUIC connection SSL object that has a default stream attached. that's it, that's the function π«Ά
SSL_get_stream_type() is the vibe-checker: it tells you what operations you can actually do on the stream, and returns one of these:
SSL_STREAM_TYPE_NONEβ the SSL object is a QUIC connection SSL object with no default stream attached. it's giving "empty", periodt.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 icon behavior π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 bestie, you can read from it, but NOT write to it. π«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 reading? not happening. π
And SSL_is_stream_local() tells you whether a stream was locally created. simple as that β¨
πΈ NOTES πΈ
ok real talk, listen up. QUICv1 gives specific meaning to the low two bits of a QUIC stream ID, BUT future versions of QUIC are not required to keep those same semantics. so do not determine stream properties using those bits, bestie, that's a trap π. instead, use SSL_get_stream_type() for the stream type and SSL_get_stream_is_local() for the stream initiator.
Also: SSL_get_stream_type() identifies the type of a QUIC stream based on its identity β it does not tell you whether an operation can currently succeed on that stream. like, you might locally initiate a unidirectional stream, write to it, then conclude the stream using SSL_stream_conclude(3), meaning it can't be written to anymore β but SSL_get_stream_type() would still return SSL_STREAM_TYPE_WRITE. the value it returns does not vary over the lifespan of a stream. it's consistent, it's loyal, it's not changing for anyone π
β RETURN VALUES β
SSL_get_stream_id()returns a QUIC stream ID. OR it returnsUINT64_MAXif you call it on an SSL object that isn't a QUIC SSL object, or on a QUIC connection SSL object without a default stream attached. and heads up: valid QUIC stream IDs are always below 2**62, iykyk.SSL_get_stream_type()returns one of theSSL_STREAM_TYPEvalues. that's the whole mood.SSL_is_stream_local()returns1if you call it on a QUIC stream SSL object representing a locally initiated stream. It returns0if you call it on a QUIC stream SSL object representing a stream that was remotely initiated by a peer, and-1if you call it on any other kind of SSL object. three possible answers, pick your fighter π
π₯ SEE ALSO π₯
SSL_new_stream(3), SSL_accept_stream(3) β go read those next bestie, they're literally right there π«Ά
π HISTORY π
These functions were added in OpenSSL 3.2. so if you're on something older... no they're not. upgrade babe π
π 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>.
and that's the whole page bestie!! π this absolute icon of a manpage is from 3.5.6, dated 2026-04-07, and it's filed under SSL_GET_STREAM_ID(3ossl) β go forth and get those stream IDs, mwah πβ¨
π¦ where this page comes from
- freebsd 15.1: base 15.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms