SSL_GET_CONN_CLOSE_INFO(3ossl)
π NAME π
okay so bestie, welcome to SSL_GET_CONN_CLOSE_INFO(3ossl) from OpenSSL π β this page is the whole squad of things that tell you why a QUIC connection was closed. The names on this page are:
SSL_get_conn_close_infoSSL_CONN_CLOSE_FLAG_LOCALSSL_CONN_CLOSE_FLAG_TRANSPORTOSSL_QUIC_ERR_NO_ERROROSSL_QUIC_ERR_INTERNAL_ERROROSSL_QUIC_ERR_CONNECTION_REFUSEDOSSL_QUIC_ERR_FLOW_CONTROL_ERROROSSL_QUIC_ERR_STREAM_LIMIT_ERROROSSL_QUIC_ERR_STREAM_STATE_ERROROSSL_QUIC_ERR_FINAL_SIZE_ERROROSSL_QUIC_ERR_FRAME_ENCODING_ERROROSSL_QUIC_ERR_TRANSPORT_PARAMETER_ERROROSSL_QUIC_ERR_CONNECTION_ID_LIMIT_ERROROSSL_QUIC_ERR_PROTOCOL_VIOLATIONOSSL_QUIC_ERR_INVALID_TOKENOSSL_QUIC_ERR_APPLICATION_ERROROSSL_QUIC_ERR_CRYPTO_BUFFER_EXCEEDEDOSSL_QUIC_ERR_KEY_UPDATE_ERROROSSL_QUIC_ERR_AEAD_LIMIT_REACHEDOSSL_QUIC_ERR_NO_VIABLE_PATHOSSL_QUIC_ERR_CRYPTO_ERR_BEGINOSSL_QUIC_ERR_CRYPTO_ERR_ENDOSSL_QUIC_ERR_CRYPTO_ERROSSL_QUIC_LOCAL_ERR_IDLE_TIMEOUT
and the whole point is get information about why a QUIC connection was closed. periodt. π
β¨ SYNOPSIS β¨
#include <openssl/ssl.h>
#define SSL_CONN_CLOSE_FLAG_LOCAL
#define SSL_CONN_CLOSE_FLAG_TRANSPORT
typedef struct ssl_conn_close_info_st {
uint64_t error_code, frame_type;
char *reason;
size_t reason_len;
uint32_t flags;
} SSL_CONN_CLOSE_INFO;
int SSL_get_conn_close_info(SSL *ssl, SSL_CONN_CLOSE_INFO *info,
size_t info_len);
#define OSSL_QUIC_ERR_NO_ERROR 0x00
#define OSSL_QUIC_ERR_INTERNAL_ERROR 0x01
#define OSSL_QUIC_ERR_CONNECTION_REFUSED 0x02
#define OSSL_QUIC_ERR_FLOW_CONTROL_ERROR 0x03
#define OSSL_QUIC_ERR_STREAM_LIMIT_ERROR 0x04
#define OSSL_QUIC_ERR_STREAM_STATE_ERROR 0x05
#define OSSL_QUIC_ERR_FINAL_SIZE_ERROR 0x06
#define OSSL_QUIC_ERR_FRAME_ENCODING_ERROR 0x07
#define OSSL_QUIC_ERR_TRANSPORT_PARAMETER_ERROR 0x08
#define OSSL_QUIC_ERR_CONNECTION_ID_LIMIT_ERROR 0x09
#define OSSL_QUIC_ERR_PROTOCOL_VIOLATION 0x0A
#define OSSL_QUIC_ERR_INVALID_TOKEN 0x0B
#define OSSL_QUIC_ERR_APPLICATION_ERROR 0x0C
#define OSSL_QUIC_ERR_CRYPTO_BUFFER_EXCEEDED 0x0D
#define OSSL_QUIC_ERR_KEY_UPDATE_ERROR 0x0E
#define OSSL_QUIC_ERR_AEAD_LIMIT_REACHED 0x0F
#define OSSL_QUIC_ERR_NO_VIABLE_PATH 0x10
/* Inclusive range for handshake-specific errors. */
#define OSSL_QUIC_ERR_CRYPTO_ERR_BEGIN 0x0100
#define OSSL_QUIC_ERR_CRYPTO_ERR_END 0x01FF
#define OSSL_QUIC_ERR_CRYPTO_ERR(X)
#define OSSL_QUIC_LOCAL_ERR_IDLE_TIMEOUT
π¦ DESCRIPTION π¦
The SSL_get_conn_close_info() function provides information about why and how a QUIC connection was closed. obsessed. π
Connection closure information is written to *info, which must be non-NULL. info_len must be set to sizeof(*info).
The following fields are set:
error_codeβ This is a 62-bit QUIC error code. It is either a 62-bit application error code (ifSSL_CONN_CLOSE_FLAG_TRANSPORTnot set inflags) or a 62-bit standard QUIC transport error code (ifSSL_CONN_CLOSE_FLAG_TRANSPORTis set inflags).frame_typeβ IfSSL_CONN_CLOSE_FLAG_TRANSPORTis set, this may be set to a QUIC frame type number which caused the connection to be closed. It may also be set to 0 if no frame type was specified as causing the connection to be closed. IfSSL_CONN_CLOSE_FLAG_TRANSPORTis not set, this is set to 0.reasonβ If non-NULL, this is intended to be a UTF-8 textual string briefly describing the reason for connection closure. The length of the reason string in bytes is given inreason_len. While, if non-NULL, OpenSSL guarantees that this string will be zero terminated, consider that this buffer may originate from the (untrusted) peer and thus may also contain zero bytes elsewhere. Therefore, use ofreason_lenis recommended.
While it is intended as per the QUIC protocol that this be a UTF-8 string, there is no guarantee that this is the case for strings received from the peer.
SSL_CONN_CLOSE_FLAG_LOCALβ IfflagshasSSL_CONN_CLOSE_FLAG_LOCALset, connection closure was locally triggered. This could be due to an application request (e.g. ifSSL_CONN_CLOSE_FLAG_TRANSPORTis unset), or (ifSSL_CONN_CLOSE_FLAG_TRANSPORTis set) due to logic internal to the QUIC implementation (for example, if the peer engages in a protocol violation, or an idle timeout occurs).
If unset, connection closure was remotely triggered.
SSL_CONN_CLOSE_FLAG_TRANSPORTβ IfflagshasSSL_CONN_CLOSE_FLAG_TRANSPORTset, connection closure was triggered for QUIC protocol reasons. Otherwise, connection closure was triggered by the local or remote application.
The OSSL_QUIC_ERR macro definitions provide the QUIC transport error codes as defined by RFC 9000. The OSSL_QUIC_ERR_CRYPTO_ERR() macro can be used to convert a TLS alert code into a QUIC transport error code by mapping it into the range reserved for such codes by RFC 9000. This range begins at OSSL_QUIC_ERR_CRYPTO_ERR_BEGIN and ends at OSSL_QUIC_ERR_CRYPTO_ERR_END inclusive. π
lowkey important: thatreasonbuffer can come from the peer, so don't just vibe with it as a regular C string β usereason_len. no cap. π
π¨ NON-STANDARD TRANSPORT ERROR CODES π¨
Some conditions which can cause QUIC connection termination are not signalled on the wire and therefore do not have standard error codes. OpenSSL indicates these errors via SSL_get_conn_close_info() by setting SSL_CONN_CLOSE_FLAG_TRANSPORT and using one of the following error values. These codes are specific to OpenSSL, and cannot be sent over the wire, as they are above 2**62. iconic but forbidden on the wire. π₯
OSSL_QUIC_LOCAL_ERR_IDLE_TIMEOUTβ The connection was terminated immediately due to the idle timeout expiring.
β RETURN VALUES β
SSL_get_conn_close_info() returns 1 on success and 0 on failure. This function fails if called on a QUIC connection SSL object which has not yet been terminated. It also fails if called on a QUIC stream SSL object or a non-QUIC SSL object. read the room: wrong object type = no info. π
πΈ SEE ALSO πΈ
π§ HISTORY π§
This function was added in OpenSSL 3.2.
π COPYRIGHT π
Copyright 2002-2024 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>.
okay bestie, that's the whole page π«Ά this cutie is from OpenSSL 3.5.0, dated 2026-09-25, and its manual name is SSL_GET_CONN_CLOSE_INFO(3ossl) β bye, slay, and read your error codes responsibly πβ¨
π¦ where this page comes from
- opensuse-leap 16.0: openssl-3-doc 3.5.0-160000.11.1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms