SSL_CTX_add_custom_ext

Register a custom TLS extension for client and/or server using the extended callback API.

Synopsis

Declared in <openssl/ssl.h>

int
SSL_CTX_add_custom_ext(
    SSL_CTX* ctx,
    unsigned int ext_type,
    unsigned int context,
    SSL_custom_ext_add_cb_ex add_cb,
    SSL_custom_ext_free_cb_ex free_cb,
    void* add_arg,
    SSL_custom_ext_parse_cb_ex parse_cb,
    void* parse_arg);

Return Value

1 on success, or 0 on error.

Parameters

NameDescription
ctxSSL context that sends or receives the extension.
ext_typeExtension type code (must not collide with OpenSSL-built-in handlers).
contextBitmask of SSL_EXT_* contexts in which the extension is relevant.
add_cbCallback that constructs extension data to send, or NULL.
free_cbOptional callback to free data produced by add_cb.
add_argApplication argument passed to add_cb and free_cb.
parse_cbCallback that parses extension data received from the peer, or NULL.
parse_argApplication argument passed to parse_cb.