SSL_CTX_SET_...PROTO_VERSION(3ossl)
π SSL_CTX_SET_...PROTO_VERSION π
okay bestie, this is the 3ossl manual page and it's literally all about picking which TLS/DTLS protocol versions your thing is allowed to speak. no cap, it's more useful than it sounds π«Ά
β¨ NAME β¨
SSL_CTX_set_min_proto_version, SSL_CTX_set_max_proto_version, SSL_CTX_get_min_proto_version, SSL_CTX_get_max_proto_version, SSL_set_min_proto_version, SSL_set_max_proto_version, SSL_get_min_proto_version, SSL_get_max_proto_version β get and set the minimum and maximum supported protocol version π
πΈ SYNOPSIS πΈ
#include <openssl/ssl.h>
int SSL_CTX_set_min_proto_version(SSL_CTX *ctx, int version);
int SSL_CTX_set_max_proto_version(SSL_CTX *ctx, int version);
int SSL_CTX_get_min_proto_version(SSL_CTX *ctx);
int SSL_CTX_get_max_proto_version(SSL_CTX *ctx);
int SSL_set_min_proto_version(SSL *ssl, int version);
int SSL_set_max_proto_version(SSL *ssl, int version);
int SSL_get_min_proto_version(SSL *ssl);
int SSL_get_max_proto_version(SSL *ssl);
π¦ DESCRIPTION π¦
so these functions get or set the minimum and maximum supported protocol versions for the ctx or the ssl. that's the whole vibe π«
they work together with the options you set via SSL_CTX_set_options(3) β those also let you disable specific protocol versions. but bestie, use these functions instead of disabling specific protocol versions, okay? that's literally the whole point π
setting the minimum or maximum version to 0 (which is the default) will enable protocol versions down to the lowest version, or up to the highest version supported by the library, respectively. and heads up β the supported versions might be controlled by system configuration, so it's not always just up to you π
the getters return 0 in case ctx or ssl have been configured to automatically use the lowest or highest version supported by the library.
currently supported versions are SSL3_VERSION, TLS1_VERSION, TLS1_1_VERSION, TLS1_2_VERSION, TLS1_3_VERSION for TLS, and DTLS1_VERSION, DTLS1_2_VERSION for DTLS. periodt β¨
π§ real talk: in the current version of OpenSSL only QUICv1 is supported in conjunction with TLSv1.3. and calling these functions on a QUIC object has no effect β like, zero, nada, nothing π
π RETURN VALUES π
- the setter functions return
1on success and0on failure β simple slay π - the getter functions return the configured version, or
0for auto-configuration of the lowest or highest protocol, respectively.
β NOTES β
ngl this is the fun bit: all these functions are implemented using macros. iykyk π
π SEE ALSO π
π HISTORY π
- the setter functions were added in OpenSSL
1.1.0π - the getter functions were added in OpenSSL
1.1.1π¦
π COPYRIGHT π
Copyright 2016-2025 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 one's version 3.5.6, dated 2026-04-0, and it's the SSL_CTX_SET_...PROTO_VERSION(3ossl) girlie herself. go forth and configure your protocol versions responsibly π
β¨π
π¦ where this page comes from
- freebsd 15.1: base 15.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms