SSL_GET_PSK_IDENTITY(3ossl)

πŸ’– SSL_GET_PSK_IDENTITY πŸ’–

okay bestie, welcome to SSL_GET_PSK_IDENTITY(3ossl) β€” yes that's the whole manual name, it's giving long but we move. this is an OpenSSL page and it's actually so chill, we're just grabbing the PSK identity stuff off an SSL object. no cap. πŸŽ€


✨ NAME ✨

SSL_get_psk_identity, SSL_get_psk_identity_hint β€” get the PSK client identity and the hint, periodt.


🌸 SYNOPSIS 🌸

#include <openssl/ssl.h>

const char *SSL_get_psk_identity_hint(const SSL *ssl);
const char *SSL_get_psk_identity(const SSL *ssl);

look at those little signatures, they're so cute, both returning const char * like the icons they are πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea πŸ“

  • SSL_get_psk_identity_hint() is the one you call when you wanna retrieve the PSK identity hint that got used during the connection setup, specifically for the SSL object ssl. she's the hint-giver.
  • SSL_get_psk_identity() is her sister β€” you use her to retrieve the PSK identity that was used during the connection setup. same deal, same connection setup energy.

that's literally it, they're both just lil getters pulling info out of the connection setup that already happened. πŸ”₯


πŸ‘‘ RETURN VALUES πŸ‘‘

if it's 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 C strings. 🌈

⚠️ heads up bestie: SSL_get_psk_identity_hint() may return NULL if no PSK identity hint was used during the connection setup. so like, don't be out here dereferencing it without a check, i'm begging 😭
🚨 and this one matters SO much: the return value is valid only during the lifetime of the SSL object ssl. once that object is gone, the pointer is giving expired-milk energy. do not keep it around. not me warning you twice πŸ’€

πŸ” SEE ALSO πŸ”

go read her too, she's iconic ✨


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>.


okay that's the whole page, you ate that 🫢 this was OpenSSL 3.5.9, dated 2026-09-29, and yes the manpage title is SSL_GET_PSK_IDENTITY(3ossl) β€” say it with your chest. bye bestie, go check your NULLs πŸ’œπŸ§š

πŸ“¦ where this page comes from