SSL_GET_PSK_IDENTITY(3ossl)
π SSL_get_psk_identity β bestie edition
okay so this is the SSL_GET_PSK_IDENTITY(3ossl) page from the OpenSSL manual, and it's genuinely iconic β it's the little duo of functions that let you peek at the PSK identity and the PSK identity hint after a connection gets set up. π
β¨ NAME β¨
SSL_get_psk_identity, SSL_get_psk_identity_hint β get the PSK client identity and the hint, bestie π
πΈ SYNOPSIS πΈ
#include <openssl/ssl.h>
const char *SSL_get_psk_identity_hint(const SSL *ssl);
const char *SSL_get_psk_identity(const SSL *ssl);
π¦ DESCRIPTION π¦
okay so picture this: you've got an SSL object called ssl, and you want the receipts from the connection setup π
SSL_get_psk_identity_hint() is the one that pulls out the PSK identity hint that got used during the connection setup for that SSL object ssl. slay. β¨
and SSL_get_psk_identity(), same vibe, same energy β it retrieves the PSK identity that got used during the connection setup. fr fr π
π RETURN VALUES π
so if the return value is non-NULL:
SSL_get_psk_identity_hint()hands you back the PSK identity hint πSSL_get_psk_identity()hands you back the PSK identity π
both of them are NULL-terminated, so you can just vibe with them as normal C strings π
lowkey important tho: SSL_get_psk_identity_hint() may return NULL if no PSK identity hint was used during the connection setup. so like, don't be shocked if it's empty, it's giving "no hint for you" energy π
β οΈ big one, don't skip this: the return value is valid only during the lifetime of theSSLobjectssl. like, once thatsslobject is gone, those pointers are π not your friends anymore. don't hang onto them.
π₯ SEE ALSO π₯
ssl(7)β go read it, iykyk π
π COPYRIGHT π
Copyright 2006-2016 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 3.5.0, dated 2026-09-25, and yes it really is called SSL_GET_PSK_IDENTITY(3ossl) in the 3ossl manual section. mwah π
π¦ 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