SSL_GET_STREAM_ID(3ossl)

πŸ“¦
version 15.1 Β· 2 versions
, in freebsd 15.1

πŸ’… 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 returns UINT64_MAX if 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 the SSL_STREAM_TYPE values. that's the whole mood.
  • SSL_is_stream_local() returns 1 if you call it on a QUIC stream SSL object representing a locally initiated stream. It returns 0 if you call it on a QUIC stream SSL object representing a stream that was remotely initiated by a peer, and -1 if 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 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