Client callback that selects a PSK identity and pre‐shared key for TLSv1.2 and below.

Synopsis

Declared in <openssl/ssl.h>

typedef unsigned int(* SSL_psk_client_cb_func)(SSL*, char const*, char*, unsigned int, unsigned char*, unsigned int);

Return Value

Length of the written PSK on success (> 0), or 0 to abort the handshake.

Parameters

Name

Description

ssl

SSL connection establishing the PSK.

hint

NUL‐terminated PSK identity hint from the server, or NULL.

identity

Buffer that receives the NUL‐terminated chosen identity.

max_identity_len

Size of identity including the NUL terminator.

psk

Buffer that receives the pre‐shared key bytes.

max_psk_len

Capacity of psk in bytes.

Created with MrDocs