SSL_CTX_set_min_proto_version.3ossl - Man Page

Get and set 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

The functions get or set the minimum and maximum supported protocol versions for the ctx or ssl. This works in combination with the options set via SSL_CTX_set_options(3) that also make it possible to disable specific protocol versions. Use these functions instead of disabling specific protocol versions.

Setting the minimum or maximum version to 0, will enable protocol versions down to the lowest version, or up to the highest version supported by the library, respectively.

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.

In the current version of OpenSSL only QUICv1 is supported in conjunction with TLSv1.3. Calling these functions on a QUIC object has no effect.

Return Values

These setter functions return 1 on success and 0 on failure. The getter functions return the configured version or 0 for auto-configuration of lowest or highest protocol, respectively.

Notes

All these functions are implemented using macros.

See Also

ssl(7), SSL_CTX_set_options(3), SSL_CONF_cmd(3)

History

The setter functions were added in OpenSSL 1.1.0. The getter functions were added in OpenSSL 1.1.1.

Referenced By

ossl-guide-quic-client-block.7ossl(7), ossl-guide-tls-client-block.7ossl(7), s-nail(1), SSL_CTX_new.3ossl(3), SSL_CTX_set_options.3ossl(3).

The man pages SSL_CTX_get_max_proto_version.3ossl(3), SSL_CTX_get_min_proto_version.3ossl(3), SSL_CTX_set_max_proto_version.3ossl(3), SSL_get_max_proto_version.3ossl(3), SSL_get_min_proto_version.3ossl(3), SSL_set_max_proto_version.3ossl(3) and SSL_set_min_proto_version.3ossl(3) are aliases of SSL_CTX_set_min_proto_version.3ossl(3).

2024-09-12 3.2.2 OpenSSL