---
name: "libressl-SSL_CTX_set_min_proto_version"
section: "3"
platform: "linux"
package: "libressl"
version: "4.4.0-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/libressl-SSL_CTX_set_min_proto_version"
---

# libressl-SSL\_CTX\_set\_min\_proto\_version(3)

get and set minimum and maximum supported protocol version

## 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 minimum and maximum supported protocol version

## SYNOPSIS

SSL Library (libssl, -lssl) libcrypto

**#include \<openssl/ssl.h\>**

*int*\

**SSL\_CTX\_set\_min\_proto\_version**(*SSL\_CTX \*ctx*, *uint16\_t version*);

*int*\

**SSL\_CTX\_set\_max\_proto\_version**(*SSL\_CTX \*ctx*, *uint16\_t 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*, *uint16\_t version*);

*int*\

**SSL\_set\_max\_proto\_version**(*SSL \*ssl*, *uint16\_t version*);

*int*\

**SSL\_get\_min\_proto\_version**(*SSL \*ssl*);

*int*\

**SSL\_get\_max\_proto\_version**(*SSL \*ssl*);

## DESCRIPTION

These functions get or set the minimum and maximum supported protocol versions for *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 or up to the highest version supported by the library, respectively.

Currently supported versions are TLS1\_VERSION, TLS1\_1\_VERSION, and TLS1\_2\_VERSION for TLS and DTLS1\_VERSION and DTLS1\_2\_VERSION for DTLS.

In other implementations, these functions may be implemented as macros.

## RETURN VALUES

The setter functions return 1 on success or 0 on failure.

The getter functions return the configured version or 0 if *ctx* or *ssl* has been configured to automatically use the lowest or highest version supported by the library.

## SEE ALSO

[ssl(3)](/ssl/3.md), SSL\_CTX\_new(3), SSL\_CTX\_set\_options(3)

## HISTORY

The setter functions first appeared in BoringSSL in December 2014, with shorter names without the **proto\_** part. Two years later, OpenSSL included them in their 1.1.0 release, gratuitously changing the names; Google shrugged and adopted the longer names one month later. They have been available since OpenBSD 6.2.

The getter functions first appeared in OpenSSL 1.1.0g and have been available since OpenBSD 6.3.
