TSClientHello

Synopsis

#include <ts/apidefs.h>
type TSClientHello
type TSClientHello::TSExtensionTypeList

A type alias for an iterable container of extension type IDs.

Description

TSClientHello is an opaque handle to a TLS ClientHello message sent by a client during the TLS handshake. It provides access to the client’s TLS version, cipher suites, and extensions.

The implementation abstracts differences between OpenSSL and BoringSSL to provide a consistent interface.

Accessor Methods

The following methods are available to access ClientHello data:

bool is_available() const

Returns whether the object contains valid values. As long as TSVConnClientHelloGet() is called for a TLS connection, the return value should be true.

uint16_t get_version() const

Returns the TLS version from the ClientHello message.

const uint8_t *get_cipher_suites() const

Returns a pointer to the cipher suites buffer. The length is available via get_cipher_suites_len().

size_t get_cipher_suites_len() const

Returns the length of the cipher suites buffer in bytes.

TSClientHello::TSExtensionTypeList get_extension_types() const

Returns an iterable container of extension type IDs present in the ClientHello. This method abstracts the differences between BoringSSL (which uses an extensions buffer) and OpenSSL (which uses an extension_ids array), providing a consistent interface regardless of the SSL library in use.

void *_get_internal() const

Returns a pointer to internal implementation data. This is an internal accessor for advanced use cases. This accessor is not part of the stable public API, and plugins must not cast or rely on the returned pointer type.