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 optionsSYNOPSIS
#include <openssl/ssl.h>SSL_CTX_set_options(SSL_CTX *ctx, long options);
SSL_set_options(SSL *ssl, long options);
SSL_CTX_clear_options(SSL_CTX *ctx, long options);
SSL_clear_options(SSL *ssl, long options);
SSL_CTX_get_options(SSL_CTX *ctx);
SSL_get_options(SSL *ssl);
SSL_get_secure_renegotiation_support(SSL *ssl);
DESCRIPTION
Note: all these functions are implemented using macros.NOTES
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_OP_MICROSOFT_SESS_ID_BUG
- As of OpenBSD 5.8, this option has no effect.
- SSL_OP_NETSCAPE_CHALLENGE_BUG
- As of OpenBSD 5.8, this option has no effect.
- SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG
- As of OpenSSL 0.9.8q and 1.0.0c, this option has no effect.
- SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG
- As of OpenBSD 5.8, this option has no effect.
- SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER
- As of OpenBSD 5.8, this option has no effect.
- SSL_OP_SAFARI_ECDHE_ECDSA_BUG
- As of OpenBSD 5.8, this option has no effect.
- SSL_OP_SSLEAY_080_CLIENT_DH_BUG
- As of OpenBSD 5.8, this option has no effect.
- SSL_OP_TLS_D5_BUG
- As of OpenBSD 5.8, this option has no effect.
- SSL_OP_TLS_BLOCK_PADDING_BUG
- As of OpenBSD 5.8, this option has no effect.
- SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS
- Disables a countermeasure against a SSL 3.0/TLS 1.0 protocol vulnerability affecting CBC ciphers, which cannot be handled by some broken SSL implementations. This option has no effect for connections using other ciphers.
- SSL_OP_TLSEXT_PADDING
- Adds a padding extension to ensure the ClientHello size is never between 256 and 511 bytes in length. This is needed as a workaround for some implementations.
- SSL_OP_ALL
- All of the above bug workarounds.
- SSL_OP_TLS_ROLLBACK_BUG
-
Disable version rollback attack detection.
- SSL_OP_SINGLE_DH_USE
- Always create a new key when using temporary/ephemeral DH parameters (see SSL_CTX_set_tmp_dh_callback(3)). This option must be used to prevent small subgroup attacks, when the DH parameters were not generated using “strong” primes (e.g., when using DSA-parameters, see openssl(1)). If “strong” primes were used, it is not strictly necessary to generate a new DH key during each handshake but it is also recommended. SSL_OP_SINGLE_DH_USE should therefore be enabled whenever temporary/ephemeral DH parameters are used.
- SSL_OP_EPHEMERAL_RSA
- Always use ephemeral (temporary) RSA key when doing RSA operations (see SSL_CTX_set_tmp_rsa_callback(3)). According to the specifications, this is only done when a RSA key can only be used for signature operations (namely under export ciphers with restricted RSA keylength). By setting this option, ephemeral RSA keys are always used. This option breaks compatibility with the SSL/TLS specifications and may lead to interoperability problems with clients and should therefore never be used. Ciphers with EDH (ephemeral Diffie-Hellman) key exchange should be used instead.
- SSL_OP_CIPHER_SERVER_PREFERENCE
- When choosing a cipher, use the server's preferences instead of the client preferences. When not set, the SSL server will always follow the client's preferences. When set, the SSLv3/TLSv1 server will choose following its own preferences. Because of the different protocol, for SSLv2 the server will send its list of preferences to the client and the client chooses.
- SSL_OP_NETSCAPE_CA_DN_BUG
- As of OpenBSD 5.8, this option has no effect.
- SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG
- As of OpenBSD 5.8, this option has no effect.
- SSL_OP_NO_SSLv2
- As of OpenBSD 5.6, this option has no effect as SSLv2 support has been removed. In previous versions it disabled use of the SSLv2 protocol.
- SSL_OP_NO_SSLv3
- Do not use the SSLv3 protocol.
- SSL_OP_NO_TLSv1
- Do not use the TLSv1.0 protocol.
- SSL_OP_NO_TLSv1_1
- Do not use the TLSv1.1 protocol.
- SSL_OP_NO_TLSv1_2
- Do not use the TLSv1.2 protocol.
- 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 will, where possible, transparently make use of RFC4507bis tickets for stateless session resumption.
- SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION
- As of OpenBSD 5.6, this option has no effect. In previous versions it allowed legacy insecure renegotiation between OpenSSL and unpatched clients or servers. See the SECURE RENEGOTIATION section for more details.
- SSL_OP_LEGACY_SERVER_CONNECT
- Allow legacy insecure renegotiation between OpenSSL and unpatched servers only: this option is currently set by default. See the SECURE RENEGOTIATION section for more details.