SSL_SET_INCOM...STREAM_POLICY(3SSL)
π SSL_SET_INCOMING_STREAM_POLICY π
okay bestie, so this is a page from the OpenSSL manual, section 3SSL, and it's literally all about who gets to slide into your QUIC connection's DMs. pull up a chair. πͺ
β¨ NAME β¨
SSL_set_incoming_stream_policy, SSL_INCOMING_STREAM_POLICY_AUTO, SSL_INCOMING_STREAM_POLICY_ACCEPT, SSL_INCOMING_STREAM_POLICY_REJECT β they manage the QUIC incoming stream policy, and by "manage" I mean they decide whether randos get to open streams on your connection or get politely (or not so politely) told to leave. πͺ
πΈ SYNOPSIS πΈ
#include <openssl/ssl.h>
#define SSL_INCOMING_STREAM_POLICY_AUTO
#define SSL_INCOMING_STREAM_POLICY_ACCEPT
#define SSL_INCOMING_STREAM_POLICY_REJECT
int SSL_set_incoming_stream_policy(SSL *conn, int policy,
uint64_t app_error_code);
like, that's the whole vibe. one function, three vibes to pick from. π
π¦ DESCRIPTION π¦
SSL_set_incoming_stream_policy() changes the incoming stream policy for a QUIC connection. Depending on the policy you configure, OpenSSL QUIC may automatically reject incoming streams that the peer initiated. why tho? because we love our legacy apps and we want to protect them β the whole point is to make sure that legacy applications doing single-stream operation with a default stream on a QUIC connection SSL object don't get handed remotely-initiated streams by a peer, because those apps are not prepared to handle them. no cap. π
app_error_code is an application error code, and it's the one that gets used in any QUIC STOP_SENDING or RESET_STREAM frames generated to implement the policy. The default application error code is 0. β
so, the valid values for policy are:
SSL_INCOMING_STREAM_POLICY_AUTOβ this is the default setting, bestie. Incoming streams get accepted according to these rules:- If the default stream mode (configured using
SSL_set_default_stream_mode(3)) is set toSSL_DEFAULT_STREAM_MODE_AUTO_BIDI(the default) orSSL_DEFAULT_STREAM_MODE_AUTO_UNI, the incoming stream is rejected. sorry not sorry π - Otherwise (where the default stream mode is
SSL_DEFAULT_STREAM_MODE_NONE), the application is assumed to be stream aware, and the incoming stream is accepted. ok queen, you know what you're doing π
- If the default stream mode (configured using
SSL_INCOMING_STREAM_POLICY_ACCEPTβ always accept incoming streams, allowing them to be dequeued usingSSL_accept_stream(3). everybody's welcome, the more the merrier π«ΆSSL_INCOMING_STREAM_POLICY_REJECTβ always reject incoming streams. door's closed. periodt. π«
Where an incoming stream is rejected, it is rejected immediately, and it is literally not possible to gain access to the stream using SSL_accept_stream(3). The stream gets rejected using QUIC STOP_SENDING and RESET_STREAM frames as appropriate. it's giving "blocked and reported" π΅
π RETURN VALUES π
Returns 1 on success and 0 on failure. iconic one-or-zero behaviour, no in between. β¨
This function fails if called on a QUIC stream SSL object, or on a non-QUIC SSL object. so like... read the room before you call it. π
π SEE ALSO π
go read those too, iykyk. π
π HISTORY π
SSL_set_incoming_stream_policy() was added in OpenSSL 3.2. so it's a newer bestie, not an ancient one. π§
π 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 angel π this was OpenSSL 4.0.3, dated 2026-09-2 β go slay some QUIC streams, but like, 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