SSL_SESSION_...OCOL_VERSION(3ossl)

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

✨ SSL_SESSION_get_protocol_version πŸ’… β€” the manual page, bestie edition πŸŽ€

okay so this is the <openssl/ssl.h> page for SSL_SESSION_get_protocol_version(3ossl) and SSL_SESSION_set_protocol_version(3ossl), which honestly is such a mouthful but we move πŸ’–


🌸 NAME 🌸

SSL_SESSION_get_protocol_version, SSL_SESSION_set_protocol_version β€” bestie, this is literally just "get and set the session protocol version" πŸ¦‹


✨ SYNOPSIS ✨

#include <openssl/ssl.h>

int SSL_SESSION_get_protocol_version(const SSL_SESSION *s);
int SSL_SESSION_set_protocol_version(SSL_SESSION *s, int version);

πŸ’œ DESCRIPTION πŸ’œ

SSL_SESSION_get_protocol_version() returns the protocol version number that session s is using. that's it. that's the whole function. she just tells you the vibe check result 🌈

SSL_SESSION_set_protocol_version() sets the protocol version associated with the SSL_SESSION object s to the value version. and like, that value should be one of the version constants such as TLS1_3_VERSION etc. β€” don't just be out here making up numbers, bestie 😭

for example (fr fr, this is the actual use case), you could use this to set up a session based PSK β€” see SSL_CTX_set_psk_use_session_callback(3) πŸ”₯


🫢 RETURN VALUES 🫢

SSL_SESSION_get_protocol_version() returns a number indicating the protocol version used for the session, and that number matches the constants, e.g. TLS1_VERSION, TLS1_2_VERSION or TLS1_3_VERSION ⭐

⚠️ okay this is the important one: the SSL_SESSION_get_protocol_version() function does not perform a null check on the provided session s pointer. literally zero vibes of checking. so please, for me, make sure s is real πŸ™ˆ

SSL_SESSION_set_protocol_version() returns 1 on success or 0 on failure. iconic binary queen πŸ‘‘


πŸ¦‹ SEE ALSO πŸ¦‹


πŸŽ€ HISTORY πŸŽ€

  • SSL_SESSION_get_protocol_version() was added in OpenSSL 1.1.0 β€” a whole era πŸ’…
  • SSL_SESSION_set_protocol_version() was added in OpenSSL 1.1.1 β€” glow-up edition ✨

Copyright 2001-2018 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, bestie! 🧚 this was 3.5.0, dated 2026-09-25, straight from the OpenSSL fam β€” mwah, go read some more manpages, ily πŸ’–πŸ“

πŸ“¦ where this page comes from