SSL_CONF_CMD(3ossl)

๐Ÿ’– SSL_CONF_CMD ๐Ÿ’– (the OpenSSL one, manual section 3ossl)

okay bestie, sit down, hydrate, because this is the page for SSL_CONF_cmd and SSL_CONF_cmd_value_type from OpenSSL, and it is long. This is part 1 of 4, so don't you dare close the tab. Let's go ๐Ÿฆ‹


๐ŸŒธ NAME ๐ŸŒธ

SSL_CONF_cmd_value_type, SSL_CONF_cmd โ€” send configuration command โœจ


๐ŸŽ€ SYNOPSIS ๐ŸŽ€

#include <openssl/ssl.h>

int SSL_CONF_cmd(SSL_CONF_CTX *ctx, const char *option, const char *value);
int SSL_CONF_cmd_value_type(SSL_CONF_CTX *ctx, const char *option);

๐Ÿ’… DESCRIPTION ๐Ÿ’…

So SSL_CONF_cmd() does a configuration operation called option, with an optional parameter called value, on ctx. The whole point of it is to make life easier for applications configuring SSL_CTX or SSL structures, by giving you one shared framework for command line options or config files. it's giving "one API to rule them all" fr fr ๐Ÿ‘‘

And SSL_CONF_cmd_value_type() just tells you the type of value that option refers to. that's it. that's the whole job. iconic. ๐Ÿ’…


๐Ÿ”ฅ SUPPORTED COMMAND LINE COMMANDS ๐Ÿ”ฅ

Right now, the option names that are supported for command lines (i.e. when the flag SSL_CONF_FLAG_CMDLINE is set) are the ones listed below, bestie. Read this twice:

Note: all option names are case sensitive. No exceptions, no vibes-based guessing. ๐Ÿšจ

Unless it says otherwise, commands can be used by both clients and servers, and the value parameter isn't used. The default prefix for command line commands is -, and that's what you'll see reflected below. periodt.

  • -bugs โ€” Sets various bug workarounds. Same thing as setting SSL_OP_ALL.
  • -no_comp โ€” Disables support for SSL/TLS compression. Same as setting SSL_OP_NO_COMPRESSION. Heads up: as of OpenSSL 1.1.0, compression is off by default anyway. ๐Ÿ’€
  • -comp โ€” Enables support for SSL/TLS compression. Same as clearing SSL_OP_NO_COMPRESSION. This command was introduced in OpenSSL 1.1.0. As of OpenSSL 1.1.0, compression is off by default. TLS compression can only be used in security level 1 or lower. From OpenSSL 3.2.0 and above the default security level is 2, so this option will have no effect without also changing the security level. See SSL_CTX_set_security_level(3).
  • -no_ticket โ€” Disables support for session tickets. Same as setting SSL_OP_NO_TICKET.
  • -serverpref โ€” Use server and not client preference order when determining which cipher suite, signature algorithm or elliptic curve to use for an incoming connection. Equivalent to SSL_OP_CIPHER_SERVER_PREFERENCE. Only used by servers. ๐Ÿ‘‘
  • -client_renegotiation โ€” Allows servers to accept client-initiated renegotiation. Equivalent to setting SSL_OP_ALLOW_CLIENT_RENEGOTIATION. Only used by servers.
  • -legacy_renegotiation โ€” Permits the use of unsafe legacy renegotiation. Equivalent to setting SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION. yeah, "unsafe" is right there in the name, bestie, I'm just the messenger ๐Ÿ˜ญ
  • -no_renegotiation โ€” Disables all attempts at renegotiation in (D)TLSv1.2 and earlier. Same as setting SSL_OP_NO_RENEGOTIATION.
  • -no_resumption_on_reneg โ€” Sets SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION. Only used by servers.
  • -legacy_server_connect, -no_legacy_server_connect โ€” Permits or prohibits the use of unsafe legacy renegotiation, and this one is for OpenSSL clients only. Equivalent to setting or clearing SSL_OP_LEGACY_SERVER_CONNECT.
  • -prioritize_chacha โ€” Prioritize ChaCha ciphers when the client has a ChaCha20 cipher at the top of its preference list. This usually indicates a client without AES hardware acceleration (e.g. mobile) is in use. Equivalent to SSL_OP_PRIORITIZE_CHACHA. Only used by servers. Requires -serverpref.
  • -allow_no_dhe_kex โ€” In TLSv1.3, allow a non-(ec)dhe based key exchange mode on resumption. This means that there will be no forward secrecy for the resumed session. โš ๏ธ
  • -prefer_no_dhe_kex โ€” In TLSv1.3, on resumption, let the server prefer a non-(ec)dhe based key exchange mode over an (ec)dhe based one. Requires -allow_no_dhe_kex. Equivalent to SSL_OP_PREFER_NO_DHE_KEX. Only used by servers.
  • -strict โ€” Enables strict mode protocol handling. Equivalent to setting SSL_CERT_FLAG_TLS_STRICT.
  • -sigalgs algs โ€” This sets the supported signature algorithms for TLSv1.2 and TLSv1.3. For clients, this value is used directly for the supported signature algorithms extension. For servers, it's used to determine which signature algorithms to support.

The algs argument should be a colon separated list of signature algorithms in order of decreasing preference, in the form algorithm+hash or signature_scheme. For the default providers shipped with OpenSSL, algorithm is one of RSA, DSA or ECDSA, and hash is a supported algorithm OID short name such as SHA1, SHA224, SHA256, SHA384 or SHA512. signature_scheme is one of the signature schemes defined in TLSv1.3, specified using the IETF name, e.g., ecdsa_secp256r1_sha256, ed25519, or rsa_pss_pss_sha256. Additional providers may make available further algorithms via the TLS-SIGALG capability. Signature scheme names and public key algorithm names (but not the hash names) in the algorithm+hash form are case-insensitive. See provider-base(7).

If this option is not set then all signature algorithms supported by all activated providers are permissible.

Note: algorithms which specify a PKCS#1 v1.5 signature scheme (either by using RSA as the algorithm or by using one of the rsa_pkcs1_* identifiers) are ignored in TLSv1.3 and will not be negotiated.
  • -client_sigalgs algs โ€” This sets the supported signature algorithms associated with client authentication for TLSv1.2 and TLSv1.3. For servers, algs is used in the signature_algorithms field of a CertificateRequest message. For clients, it's used to determine which signature algorithm to use with the client certificate. If a server does not request a certificate, this option has no effect.

The syntax of algs is identical to -sigalgs. If not set, then the value set for -sigalgs will be used instead.

  • -groups groups โ€” This sets the supported groups. For clients, the groups are sent using the supported groups extension. For servers, it's used to determine which group to use. This setting affects groups used for signatures (in TLSv1.2 and earlier) and key exchange.

In its simplest form, the groups argument is a colon separated list of groups. The preferred names are the ones listed in the IANA TLS Supported Groups registry: https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#tls-parameters-8 ๐ŸŒˆ

For some groups, OpenSSL supports additional aliases. Such an alias could be a NIST name (e.g. P-256), an OpenSSL OID name (e.g. prime256v1), or some other commonly used name. Group names are case-insensitive in OpenSSL 3.5 and later. The list should be in order of preference, with the most preferred group first.

The first group listed will also be used for the key_share sent by a client in a TLSv1.3 ClientHello.

The commands below list the IANA names for TLS 1.2 and TLS 1.3, respectively:

$ openssl list -tls1_2 -tls-groups
$ openssl list -tls1_3 -tls-groups

The recommended groups for TLS 1.3 are presently documented in the default TLS group list in the OpenSSL code base. Starting with OpenSSL 3.5, the hybrid algorithm X25519MLKEM768 is first in this default list. It mitigates against threats from future quantum computers while still providing state-of-the-art classical key exchange protection. ๐Ÿ”ฎโœจ

Further details regarding post-quantum algorithm considerations are documented in the HISTORY section below.

An enriched alternative syntax, that enables clients to send multiple keyshares and allows servers to prioritise some groups over others, is described in SSL_CTX_set1_groups_list(3). Since TLS 1.2 has neither keyshares nor a hello retry mechanism, with TLS 1.2 the enriched syntax is ultimately equivalent to just a simple ordered list of groups, as with the simple form above.

  • -curves groups โ€” This is a synonym for the -groups command. same energy, different name ๐Ÿซถ
  • -named_curve curve โ€” This sets the temporary curve used for ephemeral ECDH modes. This is only applicable in TLS 1.0 and 1.1, and should not be used with later protocol versions.

The curve argument is a curve name or the special value auto, which picks an appropriate curve based on client and server preferences. The curve can be either the NIST name (e.g. P-256) or an OpenSSL OID name (e.g. prime256v1). Even with TLS 1.0 and 1.1, the default value of "auto" is strongly recommended over choosing a specific curve. Curve names are case-insensitive in OpenSSL 3.5 and later.

  • -tx_cert_comp โ€” Enables support for sending TLSv1.3 compressed certificates. ๐Ÿ“จ
  • -no_tx_cert_comp โ€” Disables support for sending TLSv1.3 compressed certificates.
  • -rx_cert_comp โ€” Enables support for receiving TLSv1.3 compressed certificates. ๐Ÿ“ฅ
  • -no_rx_cert_comp โ€” Disables support for receiving TLSv1.3 compressed certificates.
  • -comp โ€” okay so this one genuinely shows up twice in the original page, right here, and this second time there's no description attached to it. I'm not inventing anything, I'm not merging anything, I'm just reporting what's on the page. not me being a good little transcriber ๐Ÿ’…
  • -cipher ciphers โ€” Sets the TLSv1.2 and below ciphersuite list to ciphers. This list will be combined with any configured TLSv1.3 ciphersuites.
Note: syntax checking of ciphers is currently not performed unless a SSL or SSL_CTX structure is associated with ctx.
  • -ciphersuites 1.3ciphers โ€” Sets the available ciphersuites for TLSv1.3 to value. This is a colon-separated list of TLSv1.3 ciphersuite names in order of preference. This list will be combined any configured TLSv1.2 and below ciphersuites. See openssl-ciphers(1) for more information.
  • -min_protocol minprot, -max_protocol maxprot โ€” Sets the minimum and maximum supported protocol. Currently supported protocol values are SSLv3, TLSv1, TLSv1.1, TLSv1.2, TLSv1.3 for TLS; DTLSv1, DTLSv1.2 for DTLS, and None for no limit. If either the lower or upper bound is not specified then only the other bound applies, if specified. If your application supports both TLS and DTLS you can specify any of these options twice, once with a bound for TLS and again with an appropriate bound for DTLS.
To restrict the supported protocol versions use these commands rather than the deprecated alternative commands below. ๐Ÿšจ
  • -record_padding padding โ€” Controls use of TLSv1.3 record layer padding. padding is a string of the form "number[,number]" where the (required) first number is the padding block size (in octets) for application data, and the optional second number is the padding block size for handshake and alert messages. If the optional second number is omitted, the same padding will be applied to all messages.

Padding attempts to pad TLSv1.3 records so that they are a multiple of the set length on send. A value of 0 or 1 turns off padding as relevant. Otherwise, the values must be >1 or <=16384. ๐Ÿ”ข

  • -debug_broken_protocol โ€” Ignored. that's it. that's the whole description. it's giving "we don't talk about it" ๐Ÿ˜ญ

  • -no_middlebox โ€” turns off "middlebox compatibility", as described below. ๐Ÿ’…

๐ŸŒˆ Additional Options ๐ŸŒˆ

okay so these ones? SSL_CONF_cmd() is fully here for them, but the OpenSSL commands do not process them. library-only energy, bestie. ๐Ÿซถ

  • -cert file โ€” tries to use file as the certificate for the appropriate context. Right now it uses SSL_CTX_use_certificate_chain_file() if an SSL_CTX structure is set, or SSL_use_certificate_file() with filetype PEM if an SSL structure is set. Only supported if certificate operations are permitted. โœจ
  • -key file โ€” tries to use file as the private key for the appropriate context. Only supported if certificate operations are permitted. Note: if no -key option is set, then a private key is not loaded โ€” unless the flag SSL_CONF_FLAG_REQUIRE_PRIVATE is set.
  • -dhparam file โ€” tries to use file as the set of temporary DH parameters for the appropriate context. Only supported if certificate operations are permitted.
  • -no_ssl3, -no_tls1, -no_tls1_1, -no_tls1_2, -no_tls1_3 โ€” disables protocol support for SSLv3, TLSv1.0, TLSv1.1, TLSv1.2 or TLSv1.3 by setting SSL_OP_NO_SSLv3, SSL_OP_NO_TLSv1, SSL_OP_NO_TLSv1_1, SSL_OP_NO_TLSv1_2 and SSL_OP_NO_TLSv1_3 respectively. ngl these are deprecated, babes โ€” use -min_protocol and -max_protocol instead. ๐Ÿ™ˆ
  • -anti_replay, -no_anti_replay โ€” switches replay protection on or off respectively. With replay protection on, OpenSSL will automatically detect if a session ticket has been used more than once, TLSv1.3 has been negotiated, and early data is enabled on the server. A full handshake is forced if a session ticket gets used a second or subsequent time. Anti-Replay is on by default unless overridden by a configuration file, and it's only used by servers. Anti-replay measures are required for compliance with the TLSv1.3 specification. Some applications may be able to mitigate the replay risks in other ways, and in such cases the built-in OpenSSL functionality is not required. Switching off anti-replay is equivalent to SSL_OP_NO_ANTI_REPLAY. ๐Ÿ”ฅ

๐ŸŽ€ SUPPORTED CONFIGURATION FILE COMMANDS ๐ŸŽ€

So rn, the option names that work in configuration files (i.e., when the flag SSL_CONF_FLAG_FILE is set) are all listed below, bestie. Every single config file option name is case insensitive โ€” so signaturealgorithms is recognised just as well as SignatureAlgorithms. And unless it says otherwise, the value names are case insensitive too. ๐Ÿฆ‹

Note: the command prefix (if set) alters the recognised option values.

๐Ÿ’– CipherString

Sets the ciphersuite list for TLSv1.2 and below to value. This list will be combined with any configured TLSv1.3 ciphersuites. Note: syntax checking of value is currently not performed unless an SSL or SSL_CTX structure is associated with ctx.

๐Ÿ’– Ciphersuites

Sets the available ciphersuites for TLSv1.3 to value. This is a colon-separated list of TLSv1.3 ciphersuite names, in order of preference. This list will be combined any configured TLSv1.2 and below ciphersuites. See openssl-ciphers(1) for more info.

๐Ÿ’– Certificate

Attempts to use the file value as the certificate for the appropriate context. It currently uses SSL_CTX_use_certificate_chain_file() if an SSL_CTX structure is set, or SSL_use_certificate_file() with filetype PEM if an SSL structure is set. Only supported if certificate operations are permitted.

๐Ÿ’– PrivateKey

Attempts to use the file value as the private key for the appropriate context. Only supported if certificate operations are permitted. Note: if no PrivateKey option is set, then a private key is not loaded unless the SSL_CONF_FLAG_REQUIRE_PRIVATE is set.

๐Ÿ’– ChainCAFile, ChainCAPath, VerifyCAFile, VerifyCAPath

These options indicate a file or directory used for building certificate chains or verifying certificate chains. Only supported if certificate operations are permitted.

๐Ÿ’– RequestCAFile

This option indicates a file containing a set of certificates in PEM form. The subject names of the certificates are sent to the peer in the certificate_authorities extension for TLS 1.3 (in ClientHello or CertificateRequest) or in a certificate request for previous versions or TLS.

๐Ÿ’– ServerInfoFile

Attempts to use the file value in the "serverinfo" extension, using the function SSL_CTX_use_serverinfo_file.

๐Ÿ’– DHParameters

Attempts to use the file value as the set of temporary DH parameters for the appropriate context. Only supported if certificate operations are permitted.

๐Ÿ’– RecordPadding

Controls use of TLSv1.3 record layer padding. value is a string of the form "number[,number]" where the (required) first number is the padding block size (in octets) for application data, and the optional second number is the padding block size for handshake and alert messages. If the optional second number is omitted, the same padding will be applied to all messages.

Padding attempts to pad TLSv1.3 records so that they're a multiple of the set length on send. A value of 0 or 1 turns off padding as relevant. Otherwise, the values must be >1 or <=16384.

Note that for QUIC objects, padding is always performed at the packet level, so it cannot be done at the record level. And given that, when the config file is created, there's no knowledge of what kind of SSL objects are being created, this option is silently ignored for QUIC objects. ๐Ÿ’€

๐Ÿ’– SignatureAlgorithms

This sets the supported signature algorithms for TLSv1.2 and TLSv1.3. For clients, this value is used directly for the supported signature algorithms extension. For servers, it's used to determine which signature algorithms to support.

The value argument should be a colon separated list of signature algorithms, in order of decreasing preference, of the form algorithm+hash or signature_scheme. For the default providers shipped with OpenSSL, algorithm is one of RSA, DSA or ECDSA and hash is a supported algorithm OID short name such as SHA1, SHA224, SHA256, SHA384 or SHA512. signature_scheme is one of the signature schemes defined in TLSv1.3, specified using the IANA name, e.g., ecdsa_secp256r1_sha256, ed25519, or rsa_pss_pss_sha256. Signature scheme names and public key algorithm names (but not the hash names) in the algorithm+hash form are case-insensitive. Additional providers may make available further signature schemes via the TLS_SIGALG capability. See "CAPABILITIES" in provider-base(7).

If this option is not set, then all signature algorithms supported by all activated providers are permissible.

Note: algorithms which specify a PKCS#1 v1.5 signature scheme (either by using RSA as the algorithm or by using one of the rsa_pkcs1_* identifiers) are ignored in TLSv1.3 and will not be negotiated. ๐Ÿ™…โ™€๏ธ

๐Ÿ’– ClientSignatureAlgorithms

This sets the supported signature algorithms associated with client authentication for TLSv1.2 and TLSv1.3. For servers, the value is used in the signature_algorithms field of a CertificateRequest message. For clients, it's used to determine which signature algorithm to use with the client certificate. If a server does not request a certificate, this option has no effect.

The syntax of value is identical to SignatureAlgorithms. If not set, then the value set for SignatureAlgorithms will be used instead.

๐Ÿ’– Groups

This sets the supported groups. For clients, the groups are sent using the supported groups extension. For servers, it's used to determine which group to use. This setting affects groups used for signatures (in TLSv1.2 and earlier) and key exchange. The first group listed will also be used for the key_share sent by a client in a TLSv1.3 ClientHello.

The groups argument is a colon separated list of groups. The preferred names are the ones listed in the IANA TLS Supported Groups registry: https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#tls-parameters-8. For some groups, OpenSSL supports additional aliases. Such an alias could be a NIST name (e.g. P-256), an OpenSSL OID name (e.g. prime256v1), or some other commonly used name. Group names are case-insensitive in OpenSSL 3.5 and later. The list should be in order of preference, with the most preferred group first. ๐Ÿ‘‘

The commands below list the available groups for TLS 1.2 and TLS 1.3, respectively:

$ openssl list -tls1_2 -tls-groups
$ openssl list -tls1_3 -tls-groups

An enriched alternative syntax, that enables clients to send multiple keyshares and allows servers to prioritise some groups over others, is described in SSL_CTX_set1_groups_list(3). Since TLS 1.2 has neither keyshares nor a hello retry mechanism, with TLS 1.2 the enriched syntax is ultimately equivalent to just a simple ordered list of groups, as with the simple form above. โœจ

๐Ÿ’– Curves

This is a synonym for the Groups command. same vibe, different name, iykyk.

๐Ÿ’– MinProtocol

This sets the minimum supported SSL, TLS or DTLS version.

Currently supported protocol values are SSLv3, TLSv1, TLSv1.1, TLSv1.2, TLSv1.3, DTLSv1 and DTLSv1.2. The SSL and TLS bounds apply only to TLS-based contexts, while the DTLS bounds apply only to DTLS-based contexts. The command can be repeated with one instance setting a TLS bound, and the other setting a DTLS bound. The value None applies to both types of contexts and disables the limits.

๐Ÿ’– MaxProtocol

This sets the maximum supported SSL, TLS or DTLS version.

Currently supported protocol values are SSLv3, TLSv1, TLSv1.1, TLSv1.2, TLSv1.3, DTLSv1 and DTLSv1.2. The SSL and TLS bounds apply only to TLS-based contexts, while the DTLS bounds apply only to DTLS-based contexts. The command can be repeated with one instance setting a TLS bound, and the other setting a DTLS bound. The value None applies to both types of contexts and disables the limits.

๐Ÿ’– Protocol

This can be used to enable or disable certain versions of the SSL, TLS or DTLS protocol.

The value argument is a comma separated list of supported protocols to enable or disable. If a protocol is preceded by - that version is disabled.

All protocol versions are enabled by default. You need to disable at least one protocol version for this setting to have any effect. Only enabling some protocol versions does not disable the other protocol versions. periodt. ๐Ÿ’…

Currently supported protocol values are SSLv3, TLSv1, TLSv1.1, TLSv1.2, TLSv1.3, DTLSv1 and DTLSv1.2. And then there's the special value ALL, which is giving "yes, all of them, every single one" ๐Ÿ’….

Heads up bestie: this one cannot turn on protocols that got switched off by MinProtocol or MaxProtocol. It can only turn off stuff that those two still allow. So it's a one-way door, okay? ๐Ÿšช

The Protocol command is fragile and deprecated โ€” do not use it. Use MinProtocol and MaxProtocol instead. And if you absolutely must use Protocol, please make sure the resulting range of enabled protocols has no "holes". Like, if TLS 1.0 and TLS 1.2 are both enabled, make sure you also leave TLS 1.1 enabled. No swiss cheese ranges, we don't do that here ๐Ÿง€

โœจ Options โœจ

The value argument is a comma separated list of various flags to set. If a flag string is preceded by - it is disabled. For the deets on individual options, go look at the SSL_CTX_set_options(3) function.

Each option is listed below. Where an operation is enabled by default, the -flag syntax is what you need to turn it off.

  • SessionTicket โ€” session ticket support, enabled by default. It's the inverse of SSL_OP_NO_TICKET, meaning -SessionTicket is the same as setting SSL_OP_NO_TICKET.
  • Compression โ€” SSL/TLS compression support, disabled by default. Inverse of SSL_OP_NO_COMPRESSION.
  • EmptyFragments โ€” use empty fragments as a countermeasure against a SSL 3.0/TLS 1.0 protocol vulnerability affecting CBC ciphers. It is set by default. Inverse of SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS.
  • Bugs โ€” enable various bug workarounds. Same as SSL_OP_ALL.
  • DHSingle โ€” enable single use DH keys, set by default. Inverse of SSL_OP_DH_SINGLE. Only used by servers.
  • ECDHSingle โ€” enable single use ECDH keys, set by default. Inverse of SSL_OP_ECDH_SINGLE. Only used by servers.
  • ServerPreference โ€” use server and not client preference order when determining which cipher suite, signature algorithm or elliptic curve to use for an incoming connection. Equivalent to SSL_OP_CIPHER_SERVER_PREFERENCE. Only used by servers.
  • PrioritizeChaCha โ€” prioritizes ChaCha ciphers when the client has a ChaCha20 cipher at the top of its preference list. This usually indicates a mobile client is in use. Equivalent to SSL_OP_PRIORITIZE_CHACHA. Only used by servers.
  • NoResumptionOnRenegotiation โ€” set the SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION flag. Only used by servers.
  • NoRenegotiation โ€” disables all attempts at renegotiation in TLSv1.2 and earlier, same as setting SSL_OP_NO_RENEGOTIATION.
  • UnsafeLegacyRenegotiation โ€” permits the use of unsafe legacy renegotiation. Equivalent to SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION.
  • UnsafeLegacyServerConnect โ€” permits the use of unsafe legacy renegotiation for OpenSSL clients only. Equivalent to SSL_OP_LEGACY_SERVER_CONNECT.
  • EncryptThenMac โ€” use encrypt-then-mac extension, enabled by default. Inverse of SSL_OP_NO_ENCRYPT_THEN_MAC, that is, -EncryptThenMac is the same as setting SSL_OP_NO_ENCRYPT_THEN_MAC.
  • AllowNoDHEKEX โ€” in TLSv1.3 allow a non-(ec)dhe based key exchange mode on resumption. This means that there will be no forward secrecy for the resumed session. Equivalent to SSL_OP_ALLOW_NO_DHE_KEX.
  • PreferNoDHEKEX โ€” in TLSv1.3, on resumption let the server prefer a non-(ec)dhe based key exchange mode over an (ec)dhe based one. Requires AllowNoDHEKEX. Equivalent to SSL_OP_PREFER_NO_DHE_KEX. Only used by servers.
  • MiddleboxCompat โ€” if set then dummy Change Cipher Spec (CCS) messages are sent in TLSv1.3. This has the effect of making TLSv1.3 look more like TLSv1.2 so that middleboxes that do not understand TLSv1.3 will not drop the connection. This option is set by default. A future version of OpenSSL may not set this by default. Equivalent to SSL_OP_ENABLE_MIDDLEBOX_COMPAT.
  • AntiReplay โ€” if set then OpenSSL will automatically detect if a session ticket has been used more than once, TLSv1.3 has been negotiated, and early data is enabled on the server. A full handshake is forced if a session ticket is used a second or subsequent time. This option is set by default and is only used by servers. Anti-replay measures are required to comply with the TLSv1.3 specification. Some applications may be able to mitigate the replay risks in other ways and in such cases the built-in OpenSSL functionality is not required. Disabling anti-replay is equivalent to setting SSL_OP_NO_ANTI_REPLAY.
  • ExtendedMasterSecret โ€” use extended master secret extension, enabled by default. Inverse of SSL_OP_NO_EXTENDED_MASTER_SECRET, that is, -ExtendedMasterSecret is the same as setting SSL_OP_NO_EXTENDED_MASTER_SECRET.
  • RHNoEnforceEMSinFIPS โ€” allow establishing connections without EMS in FIPS mode. This is a RedHat-based OS specific option, and normally it should be set up via crypto policies.
  • CANames โ€” use CA names extension, enabled by default. Inverse of SSL_OP_DISABLE_TLSEXT_CA_NAMES, that is, -CANames is the same as setting SSL_OP_DISABLE_TLSEXT_CA_NAMES.
  • KTLS โ€” enables kernel TLS if support has been compiled in, and it is supported by the negotiated ciphersuites and extensions. Equivalent to SSL_OP_ENABLE_KTLS.
  • StrictCertCheck โ€” enable strict certificate checking. Equivalent to setting SSL_CERT_FLAG_TLS_STRICT with SSL_CTX_set_cert_flags().
  • TxCertificateCompression โ€” support sending compressed certificates, enabled by default. Inverse of SSL_OP_NO_TX_CERTIFICATE_COMPRESSION, that is, -TxCertificateCompression is the same as setting SSL_OP_NO_TX_CERTIFICATE_COMPRESSION.
  • RxCertificateCompression โ€” support receiving compressed certificates, enabled by default. Inverse of SSL_OP_NO_RX_CERTIFICATE_COMPRESSION, that is, -RxCertificateCompression is the same as setting SSL_OP_NO_RX_CERTIFICATE_COMPRESSION.
  • KTLSTxZerocopySendfile โ€” use the zerocopy TX mode of sendfile(), which gives a performance boost when used with KTLS hardware offload. Note that invalid TLS records might be transmitted if the file is changed while being sent. This option has no effect if KTLS is not enabled. Equivalent to SSL_OP_ENABLE_KTLS_TX_ZEROCOPY_SENDFILE. This option only applies to Linux. KTLS sendfile on FreeBSD doesn't offer an option to disable zerocopy and always runs in this mode.
  • IgnoreUnexpectedEOF โ€” equivalent to SSL_OP_IGNORE_UNEXPECTED_EOF. You should only enable this option if the protocol running over TLS can detect a truncation attack itself, and that the application is checking for that truncation attack. ๐Ÿ”ฅ (the "only if you know what you're doing" kind of fire)

โœจ VerifyMode โœจ

The value argument is a comma separated list of flags to set.

  • Peer โ€” enables peer verification: for clients only.
  • Request โ€” requests but does not require a certificate from the client. Servers only.
  • Require โ€” requests and requires a certificate from the client: an error occurs if the client does not present a certificate. Servers only.
  • Once โ€” requests a certificate from a client only on the initial connection, not when renegotiating. Servers only.
  • RequestPostHandshake โ€” configures the connection to support requests but does not require a certificate from the client post-handshake. A certificate will not be requested during the initial handshake. The server application must provide a mechanism to request a certificate post-handshake. Servers only. TLSv1.3 only.
  • RequiresPostHandshake โ€” configures the connection to support requests and requires a certificate from the client post-handshake: an error occurs if the client does not present a certificate. A certificate will not be requested during the initial handshake. The server application must provide a mechanism to request a certificate post-handshake. Servers only. TLSv1.3 only.

โœจ ClientCAFile, ClientCAPath โœจ

A file or directory of certificates in PEM format whose names are used as the set of acceptable names for client CAs. Servers only. This option is only supported if certificate operations are permitted. ๐Ÿซถ


โœจ SUPPORTED COMMAND TYPES โœจ

The function SSL_CONF_cmd_value_type() currently returns one of the following types:

  • SSL_CONF_TYPE_UNKNOWN โ€” the option string is unrecognised, this return value can be use to flag syntax errors.
  • SSL_CONF_TYPE_STRING โ€” the value is a string without any specific structure.
  • SSL_CONF_TYPE_FILE โ€” the value is a filename.
  • SSL_CONF_TYPE_DIR โ€” the value is a directory name.
  • SSL_CONF_TYPE_NONE โ€” the value string is not used e.g. a command line option which doesn't take an argument.

โœจ NOTES โœจ

The order of operations is significant, bestie. This can be used to set either defaults or values which cannot be overridden. For example if an application calls:

SSL_CONF_cmd(ctx, "Protocol", "-SSLv3");
SSL_CONF_cmd(ctx, userparam, uservalue);

it will disable SSLv3 support by default but the user can override it. If however the call sequence is:

SSL_CONF_cmd(ctx, userparam, uservalue);
SSL_CONF_cmd(ctx, "Protocol", "-SSLv3");

SSLv3 is always disabled and attempt to override this by the user are ignored. Like, it said what it said ๐Ÿ’…

By checking the return code of SSL_CONF_cmd() it is possible to query if a given option is recognised, this is useful if SSL_CONF_cmd() values are mixed with additional application specific operations.

For example an application might call SSL_CONF_cmd() and if it returns -2 (unrecognised command) continue with processing of application specific commands.

Applications can also use SSL_CONF_cmd() to process command lines though the utility function SSL_CONF_cmd_argv() is normally used instead. One way to do this is to set the prefix to an appropriate value using SSL_CONF_CTX_set1_prefix(), pass the current argument to option and the following argument to value (which may be NULL).

In this case if the return value is positive then it is used to skip that number of arguments as they have been processed by SSL_CONF_cmd(). If -2 is returned then option is not recognised and application specific arguments can be checked instead. If -3 is returned a required argument is missing and an error is indicated. If 0 is returned some other error occurred and this can be reported back to the user.

The function SSL_CONF_cmd_value_type() can be used by applications to check for the existence of a command or to perform additional syntax checking or translation of the command value. For example if the return value is SSL_CONF_TYPE_FILE an application could translate a relative pathname to an absolute pathname. ๐Ÿฆ‹

๐Ÿ’– RETURN VALUES ๐Ÿ’–

okay so here's the vibe check on what SSL_CONF_cmd() hands back to you, bestie, and every single number matters:

  • 1 โ€” the value of option is recognised, and value is NOT used. โœจ
  • 2 โ€” both option and value are used. In other words, it returns the number of arguments processed. This is lowkey so useful when you're processing command lines. ๐Ÿซถ
  • -2 โ€” option is not recognised. ๐Ÿ’€
  • -3 โ€” option is recognised, and the command requires a value, but value is NULL. ๐Ÿ˜ญ
  • 0 โ€” both option and value are valid, but an error happened while trying to actually do the thing. Like, say, the syntax of value was off โ€” in that case the error queue may have extra info for you. ๐Ÿ™ˆ

โœจ EXAMPLES โœจ

Set supported signature algorithms:

SSL_CONF_cmd(ctx, "SignatureAlgorithms", "ECDSA+SHA256:RSA+SHA256:DSA+SHA256");

There are various ways to select the supported protocols, and honestly each one is giving a slightly different energy. ๐Ÿ’…

This sets the minimum protocol version to TLSv1, and so disables SSLv3. This is the recommended way to disable protocols:

SSL_CONF_cmd(ctx, "MinProtocol", "TLSv1");

The following also disables SSLv3:

SSL_CONF_cmd(ctx, "Protocol", "-SSLv3");

The following will first enable all protocols, and then disable SSLv3. If no protocol versions were disabled before, this has the same effect as "-SSLv3", but if some versions were disabled, this will re-enable them before disabling SSLv3:

SSL_CONF_cmd(ctx, "Protocol", "ALL,-SSLv3");

Only enable TLSv1.2:

SSL_CONF_cmd(ctx, "MinProtocol", "TLSv1.2");
SSL_CONF_cmd(ctx, "MaxProtocol", "TLSv1.2");

This also only enables TLSv1.2:

SSL_CONF_cmd(ctx, "Protocol", "-ALL,TLSv1.2");

Disable TLS session tickets:

SSL_CONF_cmd(ctx, "Options", "-SessionTicket");

Enable compression:

SSL_CONF_cmd(ctx, "Options", "Compression");

Set supported curves to P-256, P-384:

SSL_CONF_cmd(ctx, "Curves", "P-256:P-384");

๐Ÿฆ‹ SEE ALSO ๐Ÿฆ‹


๐ŸŒˆ HISTORY ๐ŸŒˆ

the lore, bestie, in chronological order ๐Ÿ“œ:

  • The SSL_CONF_cmd() function was added in OpenSSL 1.0.2. ๐Ÿ‘‘
  • The SSL_OP_NO_SSL2 option doesn't have effect since 1.1.0, but the macro is retained for backwards compatibility. (she's retired but still on the guest list ๐Ÿ’€)
  • The SSL_CONF_TYPE_NONE was added in OpenSSL 1.1.0. In earlier versions of OpenSSL, passing a command which didn't take an argument would return SSL_CONF_TYPE_UNKNOWN. ๐Ÿ˜ญ
  • MinProtocol and MaxProtocol where added in OpenSSL 1.1.0.
  • AllowNoDHEKEX and PrioritizeChaCha were added in OpenSSL 1.1.1.
  • The UnsafeLegacyServerConnect option is no longer set by default from OpenSSL 3.0.
  • The TxCertificateCompression and RxCertificateCompression options were added in OpenSSL 3.2.
  • PreferNoDHEKEX was added in OpenSSL 3.3.

and now the 3.5 era, which is genuinely iconic: โœจ

OpenSSL 3.5 introduces support for post-quantum (PQ) TLS key exchange via the MLKEM512, MLKEM768 and MLKEM1024 TLS groups. These are based on the underlying ML-KEM-512, ML-KEM-768 and ML-KEM-1024 algorithms from FIPS 203. ๐Ÿงš

OpenSSL 3.5 also introduces support for three hybrid ECDH PQ key exchange TLS groups: X25519MLKEM768, SecP256r1MLKEM768 and SecP384r1MLKEM1024. They offer CPU performance comparable to the associated ECDH group, though at the cost of significantly larger key exchange messages. The third group, SecP384r1MLKEM1024 is substantially more CPU-intensive, largely as a result of the high CPU cost of ECDH for the underlying P-384 group. Also its key exchange messages at close to 1700 bytes are larger than the roughly 1200 bytes for the first two groups. ๐Ÿ“

As of OpenSSL 3.5 key exchange group names are case-insensitive. ๐ŸŽ€


Copyright 2012-2026 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 a wrap on the whole page, bestie ๐Ÿซถ this one's from version 3.5.9, dated 2026-09-29, and it's SSL_CONF_CMD(3ossl) โ€” go forth and configure your SSL like the main character you are ๐Ÿ‘‘๐Ÿ’…โœจ

๐Ÿ“ฆ where this page comes from