SSL_GET_PSK_IDENTITY(3ossl)

πŸ“¦ version 3.5.0, in opensuse-leap 16.0

πŸ’… 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 the SSL object ssl. like, once that ssl object is gone, those pointers are πŸ’€ not your friends anymore. don't hang onto them.

πŸ”₯ SEE ALSO πŸ”₯

  • ssl(7) β€” go read it, iykyk πŸ“š

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