SSL_GET_PSK_IDENTITY(3SSL)

πŸ’– SSL_GET_PSK_IDENTITY πŸ’–

okay bestie, welcome to the OpenSSL corner of the manual β€” this one lives in section 3SSL, and it's all about SSL_get_psk_identity and SSL_get_psk_identity_hint, aka the two little besties who fetch your PSK client identity and your hint. no cap, that's literally the whole job. ✨


πŸ¦‹ NAME πŸ¦‹

SSL_get_psk_identity, SSL_get_psk_identity_hint β€” get PSK client identity and hint 🌸


✨ 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 πŸ’…

so, SSL_get_psk_identity_hint() is the one you call when you wanna grab the PSK identity hint that got used during the connection setup, and it's tied to that specific SSL object, ssl. 🫢

and SSL_get_psk_identity()? same energy, different snack β€” it gets you the PSK identity that was used during the connection setup. two functions, one vibe. iconic. πŸ‘‘


πŸŽ€ RETURN VALUES πŸŽ€

if it's non-NULL, SSL_get_psk_identity_hint() hands you back the PSK identity hint, and SSL_get_psk_identity() hands you back the PSK identity. both of them are NULL-terminated, so they're ready to be treated like normal C strings. periodt. πŸ’–

also, heads up: SSL_get_psk_identity_hint() may return NULL if no PSK identity hint was used during the connection setup. so don't be out here dereferencing it without a vibe check, okay? πŸ™ˆ

ngl, the return value is valid only during the lifetime of the SSL object ssl. once that object is gone, so is your pointer. keep it alive or keep it moving. πŸ’€

🌈 SEE ALSO 🌈


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 version 4.0.3 of the 3SSL manual, dated 2026-09-29 β€” ate and left no crumbs πŸ’…βœ¨

πŸ“¦ where this page comes from