SSL_SESSION_...OCOL_VERSION(3ossl)
β¨ 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: theSSL_SESSION_get_protocol_version()function does not perform a null check on the provided sessionspointer. literally zero vibes of checking. so please, for me, make suresis 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 OpenSSL1.1.0β a whole era πSSL_SESSION_set_protocol_version()was added in OpenSSL1.1.1β glow-up edition β¨
π COPYRIGHT π
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
- opensuse-leap 16.0: openssl-3-doc 3.5.0-160000.11.1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms