SSL_STREAM_RESET(3ossl)

πŸ’… SSL_STREAM_RESET β€” bestie edition (3ossl)

okay so real talk, this is the 3ossl manual page for the OpenSSL function SSL_stream_reset, and it's literally the "nvm we're done here" button for a QUIC stream. you're gonna love her 🫢


✨ NAME ✨

SSL_stream_reset β€” reset a QUIC stream


🌸 SYNOPSIS 🌸

#include <openssl/ssl.h>

typedef struct ssl_stream_reset_args_st {
    uint64_t quic_error_code;
} SSL_STREAM_RESET_ARGS;

int SSL_stream_reset(SSL *ssl,
                     const SSL_STREAM_RESET_ARGS *args,
                     size_t args_len);

πŸ¦‹ DESCRIPTION πŸ¦‹

so the way that SSL_stream_reset() works is: it resets the send part of a QUIC stream when you call it on a QUIC stream SSL object, or on a QUIC connection SSL object with a default stream attached. that's the vibe. πŸ’«

if args is non-NULL, then args_len must be set to sizeof(*args). no negotiations bestie, that's the rule.

quic_error_code is an application-specified error code, and it must be in the range [0, 2**62-1]. if args is NULL, then a value of 0 is used. periodt.

now here's the part where we get serious for a sec 😭. resetting a stream indicates to an application that the sending part of the stream is terminating abnormally. when a stream is reset, the implementation does not guarantee that any data already passed to SSL_write(3) will be received by the peer, and data already passed to SSL_write(3) but not yet transmitted may or may not be discarded. it's giving chaos, honestly. so you should only reset a stream when the information transmitted on the stream no longer matters β€” for example due to an error condition.

bestie pls read this twice: reset = the peer might not get your data, and your queued-but-unsent data is a coin flip. don't do this to information you still care about πŸ™ˆ

this function cannot be called on a unidirectional stream initiated by the peer, because only the sending side of a stream can initiate a stream reset. it's not her stream, so she doesn't get to reset it πŸ’…

it's also possible to trigger a stream reset by calling SSL_free(3) β€” go read the documentation for SSL_free(3) for the deets. ✨

and the good news: the receiving part of the stream (for bidirectional streams) keeps functioning normally. she's fine, she's thriving, she didn't even notice πŸ’–


πŸ“ NOTES πŸ“

this function corresponds to the QUIC RESET_STREAM frame. iykyk πŸŽ€


⭐ RETURN VALUES ⭐

returns 1 on success and 0 on failure. iconic binary behaviour, no in-between.

this function fails if called on a QUIC connection SSL object without a default stream attached, or on a non-QUIC SSL object. nope nope nope 🚫

after the first call to this function succeeds for a given stream, subsequent calls succeed but are ignored. the application error code used is that passed to the first successful call to this function. so the first girl to speak sets the tone, and everyone after her is just background vocals πŸ‘‘


πŸ‘€ SEE ALSO πŸ‘€


πŸ“œ HISTORY πŸ“œ

SSL_stream_reset() was added in OpenSSL 3.2. a relatively recent queen, and we respect her 🌈


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 was the SSL_STREAM_RESET(3ossl) page, coming at you from OpenSSL version 3.5.9, dated 2026-09-29 πŸ’– go forth, reset responsibly, and remember: only the sending side gets to slam the door πŸšͺβœ¨πŸ¦‹

πŸ“¦ where this page comes from