SSL_GET_PSK_IDENTITY(3ossl)

πŸ“¦
version 15.1 Β· 3 versions
, in freebsd 15.1

πŸ’– NAME πŸ’–

okay so bestie, gather round β€” SSL_get_psk_identity, SSL_get_psk_identity_hint β€” these two are literally your go-to for getting the PSK client identity and the hint. that's the whole vibe. (and yes, we're in the 3ossl manual, welcome, make yourself comfy 🫢)


✨ SYNOPSIS ✨

#include <openssl/ssl.h>

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

like, that's it. two functions. no cap. πŸŽ€


🌸 DESCRIPTION 🌸

so SSL_get_psk_identity_hint() is the one you call to retrieve the PSK identity hint that got used during connection setup for the SSL object ssl. think of it as the little "hey, who are you?" nudge the server sends. πŸ’…

and SSL_get_psk_identity(), its sister function, is what you use to retrieve the PSK identity used during the connection setup. the actual name tag. the main character. πŸ‘‘

same energy, different facts. iykyk. πŸ¦‹


⭐ RETURN VALUES ⭐

if it's non-NULL, SSL_get_psk_identity_hint() returns the PSK identity hint, and SSL_get_psk_identity() returns the PSK identity. both of them are NULL-terminated, so you can just vibe with them as C strings. ✨

fun little detail: SSL_get_psk_identity_hint() may return NULL if no PSK identity hint was used during the connection setup. so like, don't panic if you get NULL, it's not always a you problem. πŸ™ˆ

⚠️ okay important one, bestie: the return value is valid only during the lifetime of the SSL object ssl. the way that means you gotta keep ssl alive while you're using these strings. don't go holding onto them after ssl is gone, that's giving undefined chaos πŸ’€

πŸ”₯ SEE ALSO πŸ”₯

  • ssl(7) β€” go read it, it's the whole lore 🌈

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 page!! πŸ’œ shipped as 3.5.6, dated 2026-04-07, from the SSL_GET_PSK_IDENTITY(3ossl) household β€” go forth and slay those PSK identities, bestie πŸ§šπŸ“πŸŽ€

πŸ“¦ where this page comes from