SSL_CTX_SET_...PROTO_VERSION(3ossl)

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

πŸ’… 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 1 on success and 0 on failure β€” simple slay πŸŽ€
  • the getter functions return the configured version, or 0 for 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 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