---
name: "libressl-SSL_CTX_set_options"
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_options"
---

# libressl-SSL\_CTX\_set\_options(3)

manipulate SSL options

## NAME

**SSL\_CTX\_set\_options**, **SSL\_set\_options**, **SSL\_CTX\_clear\_options**, **SSL\_clear\_options**, **SSL\_CTX\_get\_options**, **SSL\_get\_options**, **SSL\_get\_secure\_renegotiation\_support** – manipulate SSL options

## SYNOPSIS

SSL Library (libssl, -lssl) libcrypto

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

*long*\

**SSL\_CTX\_set\_options**(*SSL\_CTX \*ctx*, *long options*);

*long*\

**SSL\_set\_options**(*SSL \*ssl*, *long options*);

*long*\

**SSL\_CTX\_clear\_options**(*SSL\_CTX \*ctx*, *long options*);

*long*\

**SSL\_clear\_options**(*SSL \*ssl*, *long options*);

*long*\

**SSL\_CTX\_get\_options**(*SSL\_CTX \*ctx*);

*long*\

**SSL\_get\_options**(*SSL \*ssl*);

*long*\

**SSL\_get\_secure\_renegotiation\_support**(*SSL \*ssl*);

## DESCRIPTION

**SSL\_CTX\_set\_options**() adds the options set via bitmask in *options* to *ctx*. Options already set before are not cleared!

**SSL\_set\_options**() adds the options set via bitmask in *options* to *ssl*. Options already set before are not cleared!

**SSL\_CTX\_clear\_options**() clears the options set via bitmask in *options* to *ctx*.

**SSL\_clear\_options**() clears the options set via bitmask in *options* to *ssl*.

**SSL\_CTX\_get\_options**() returns the options set for *ctx*.

**SSL\_get\_options**() returns the options set for *ssl*.

**SSL\_get\_secure\_renegotiation\_support**() indicates whether the peer supports secure renegotiation.

All these functions are implemented using macros.

The behaviour of the SSL library can be changed by setting several options. The options are coded as bitmasks and can be combined by a bitwise OR operation (\|).

**SSL\_CTX\_set\_options**() and **SSL\_set\_options**() affect the (external) protocol behaviour of the SSL library. The (internal) behaviour of the API can be changed by using the similar SSL\_CTX\_set\_mode(3) and SSL\_set\_mode(3) functions.

During a handshake, the option settings of the SSL object are used. When a new SSL object is created from a context using SSL\_new(3), the current option setting is copied. Changes to *ctx* do not affect already created *SSL* objects. **SSL\_clear**() does not affect the settings.

The following *bug* *workaround* options are available:

- SSL\_OP\_ALL

  This currently does nothing.

It is usually safe to use SSL\_OP\_ALL to enable the bug workaround options if compatibility with somewhat broken implementations is desired.

The following *modifying* options are available:

- SSL\_OP\_CIPHER\_SERVER\_PREFERENCE

  When choosing a cipher, use the server's preferences instead of the client preferences. When not set, the server will always follow the client's preferences. When set, the server will choose following its own preferences.

- SSL\_OP\_COOKIE\_EXCHANGE

  Turn on Cookie Exchange as described in RFC 4347 Section 4.2.1. Only affects DTLS connections.

- SSL\_OP\_LEGACY\_SERVER\_CONNECT

  Allow connections to legacy servers that do not support secure renegotiation. This option is not set by default.

- SSL\_OP\_NO\_DTLSv1

  Do not use the DTLSv1 protocol. Deprecated; use SSL\_CTX\_set\_min\_proto\_version(3) instead.

- SSL\_OP\_NO\_DTLSv1\_2

  Do not use the DTLSv1.2 protocol. Deprecated; use SSL\_CTX\_set\_min\_proto\_version(3) instead.

- SSL\_OP\_NO\_QUERY\_MTU

  Do not query the MTU. Only affects DTLS connections.

- SSL\_OP\_NO\_SESSION\_RESUMPTION\_ON\_RENEGOTIATION

  When performing renegotiation as a server, always start a new session (i.e., session resumption requests are only accepted in the initial handshake). This option is not needed for clients.

- SSL\_OP\_NO\_TICKET

  Normally clients and servers using TLSv1.2 and earlier will, where possible, transparently make use of RFC 5077 tickets for stateless session resumption.

  If this option is set, this functionality is disabled and tickets will not be used by clients or servers.

- SSL\_OP\_NO\_TLSv1

  Do not use the TLSv1.0 protocol. Deprecated; use SSL\_CTX\_set\_min\_proto\_version(3) instead.

- SSL\_OP\_NO\_TLSv1\_1

  Do not use the TLSv1.1 protocol. Deprecated; use SSL\_CTX\_set\_min\_proto\_version(3) instead.

- SSL\_OP\_NO\_TLSv1\_2

  Do not use the TLSv1.2 protocol. Deprecated; use SSL\_CTX\_set\_max\_proto\_version(3) instead.

The following options used to be supported at some point in the past and no longer have any effect: SSL\_OP\_ALLOW\_UNSAFE\_LEGACY\_RENEGOTIATION, SSL\_OP\_DONT\_INSERT\_EMPTY\_FRAGMENTS, SSL\_OP\_EPHEMERAL\_RSA, SSL\_OP\_MICROSOFT\_BIG\_SSLV3\_BUFFER, SSL\_OP\_MICROSOFT\_SESS\_ID\_BUG, SSL\_OP\_NETSCAPE\_CA\_DN\_BUG, SSL\_OP\_NETSCAPE\_CHALLENGE\_BUG, SSL\_OP\_NETSCAPE\_DEMO\_CIPHER\_CHANGE\_BUG, SSL\_OP\_NETSCAPE\_REUSE\_CIPHER\_CHANGE\_BUG, SSL\_OP\_NO\_COMPRESSION, SSL\_OP\_NO\_SSLv2, SSL\_OP\_NO\_SSLv3, SSL\_OP\_PKCS1\_CHECK\_1, SSL\_OP\_PKCS1\_CHECK\_2, SSL\_OP\_SAFARI\_ECDHE\_ECDSA\_BUG, SSL\_OP\_SINGLE\_DH\_USE, SSL\_OP\_SINGLE\_ECDH\_USE, SSL\_OP\_SSLEAY\_080\_CLIENT\_DH\_BUG, SSL\_OP\_SSLREF2\_REUSE\_CERT\_TYPE\_BUG, SSL\_OP\_TLS\_BLOCK\_PADDING\_BUG, SSL\_OP\_TLS\_D5\_BUG, SSL\_OP\_TLS\_ROLLBACK\_BUG, SSL\_OP\_TLSEXT\_PADDING.

## RETURN VALUES

**SSL\_CTX\_set\_options**() and **SSL\_set\_options**() return the new options bitmask after adding *options*.

**SSL\_CTX\_clear\_options**() and **SSL\_clear\_options**() return the new options bitmask after clearing *options*.

**SSL\_CTX\_get\_options**() and **SSL\_get\_options**() return the current bitmask.

**SSL\_get\_secure\_renegotiation\_support**() returns 1 is the peer supports secure renegotiation and 0 if it does not.

## SEE ALSO

[openssl(1)](/openssl/1.md), [ssl(3)](/ssl/3.md), SSL\_clear(3), SSL\_CTX\_ctrl(3), SSL\_CTX\_set\_min\_proto\_version(3), SSL\_new(3)

## HISTORY

**SSL\_CTX\_set\_options**() and **SSL\_set\_options**() first appeared in SSLeay 0.9.0 and have been available since OpenBSD 2.4.

**SSL\_CTX\_get\_options**() and **SSL\_get\_options**() first appeared in OpenSSL 0.9.2b and have been available since OpenBSD 2.6.

**SSL\_CTX\_clear\_options**(), **SSL\_clear\_options**(), and **SSL\_get\_secure\_renegotiation\_support**() first appeared in OpenSSL 0.9.8m and have been available since OpenBSD 4.9.
