---
name: "SSL_get_stream_id"
section: "3ssl"
platform: "linux"
package: "openssl"
version: "3.6.5-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/SSL_get_stream_id"
---

# SSL\_get\_stream\_id(3ssl)

get QUIC stream ID and stream type information

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

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

The **SSL\_get\_stream\_id()** function returns the QUIC stream ID for a QUIC stream SSL object, or for a QUIC connection SSL object which has a default stream attached.

The **SSL\_get\_stream\_type()** function identifies what operations can be performed on the stream, and returns one of the following values:

- **SSL\_STREAM\_TYPE\_NONE**

  The SSL object is a QUIC connection SSL object without a default stream attached.

- **SSL\_STREAM\_TYPE\_BIDI**

  The SSL object is a non-QUIC SSL object, or is a QUIC stream object (or QUIC connection SSL object with a default stream attached), and that stream is a bidirectional QUIC stream.

- **SSL\_STREAM\_TYPE\_READ**

  The SSL object is a QUIC stream object (or QUIC connection SSL object with a default stream attached), and that stream is a unidirectional QUIC stream which was initiated by the remote peer; thus, it can be read from, but not written to.

- **SSL\_STREAM\_TYPE\_WRITE**

  The SSL object is a QUIC stream object (or QUIC connection SSL object with a default stream attached), and that stream is a unidirectional QUIC stream which was initiated by the local application; thus, it can be written to, but not read from.

The **SSL\_is\_stream\_local()** function determines whether a stream was locally created.

## NOTES

While QUICv1 assigns specific meaning to the low two bits of a QUIC stream ID, QUIC stream IDs in future versions of QUIC are not required to have the same semantics. Do not determine stream properties using these bits. Instead, use **SSL\_get\_stream\_type()** to determine the stream type and **SSL\_get\_stream\_is\_local()** to determine the stream initiator.

The **SSL\_get\_stream\_type()** identifies the type of a QUIC stream based on its identity, and 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**. 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, or **UINT64\_MAX** if called on an SSL object which is not a QUIC SSL object, or if called 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.

**SSL\_is\_stream\_local()** returns 1 if called on a QUIC stream SSL object which represents a stream which was locally initiated. It returns 0 if called on a QUIC stream SSL object which represents a stream which was remotely initiated by a peer, and -1 if called on any other kind of SSL object.

## SEE ALSO

**SSL\_new\_stream**(3), **SSL\_accept\_stream**(3)

## HISTORY

These functions were added in OpenSSL 3.2.

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