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 settingSSL_OP_ALL.-no_compโ Disables support for SSL/TLS compression. Same as settingSSL_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 clearingSSL_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. SeeSSL_CTX_set_security_level(3).-no_ticketโ Disables support for session tickets. Same as settingSSL_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 toSSL_OP_CIPHER_SERVER_PREFERENCE. Only used by servers. ๐-client_renegotiationโ Allows servers to accept client-initiated renegotiation. Equivalent to settingSSL_OP_ALLOW_CLIENT_RENEGOTIATION. Only used by servers.-legacy_renegotiationโ Permits the use of unsafe legacy renegotiation. Equivalent to settingSSL_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 settingSSL_OP_NO_RENEGOTIATION.-no_resumption_on_renegโ SetsSSL_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 clearingSSL_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 toSSL_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 toSSL_OP_PREFER_NO_DHE_KEX. Only used by servers.-strictโ Enables strict mode protocol handling. Equivalent to settingSSL_CERT_FLAG_TLS_STRICT.-sigalgsalgsโ 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 usingRSAas the algorithm or by using one of thersa_pkcs1_*identifiers) are ignored in TLSv1.3 and will not be negotiated.
-client_sigalgsalgsโ This sets the supported signature algorithms associated with client authentication for TLSv1.2 and TLSv1.3. For servers,algsis used in thesignature_algorithmsfield of aCertificateRequestmessage. 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.
-groupsgroupsโ 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.
-curvesgroupsโ This is a synonym for the-groupscommand. same energy, different name ๐ซถ-named_curvecurveโ 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 ๐-cipherciphersโ Sets the TLSv1.2 and below ciphersuite list tociphers. This list will be combined with any configured TLSv1.3 ciphersuites.
Note: syntax checking ofciphersis currently not performed unless aSSLorSSL_CTXstructure is associated withctx.
-ciphersuites1.3ciphersโ Sets the available ciphersuites for TLSv1.3 tovalue. 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. Seeopenssl-ciphers(1)for more information.-min_protocolminprot,-max_protocolmaxprotโ Sets the minimum and maximum supported protocol. Currently supported protocol values areSSLv3,TLSv1,TLSv1.1,TLSv1.2,TLSv1.3for TLS;DTLSv1,DTLSv1.2for DTLS, andNonefor 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_paddingpaddingโ Controls use of TLSv1.3 record layer padding.paddingis 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. ๐ซถ
-certfile โ tries to use file as the certificate for the appropriate context. Right now it usesSSL_CTX_use_certificate_chain_file()if anSSL_CTXstructure is set, orSSL_use_certificate_file()with filetypePEMif anSSLstructure is set. Only supported if certificate operations are permitted. โจ-keyfile โ tries to use file as the private key for the appropriate context. Only supported if certificate operations are permitted. Note: if no-keyoption is set, then a private key is not loaded โ unless the flagSSL_CONF_FLAG_REQUIRE_PRIVATEis set.-dhparamfile โ 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 settingSSL_OP_NO_SSLv3,SSL_OP_NO_TLSv1,SSL_OP_NO_TLSv1_1,SSL_OP_NO_TLSv1_2andSSL_OP_NO_TLSv1_3respectively. ngl these are deprecated, babes โ use-min_protocoland-max_protocolinstead. ๐-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 toSSL_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? ๐ช
TheProtocolcommand is fragile and deprecated โ do not use it. UseMinProtocolandMaxProtocolinstead. And if you absolutely must useProtocol, 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 ofSSL_OP_NO_TICKET, meaning-SessionTicketis the same as settingSSL_OP_NO_TICKET.Compressionโ SSL/TLS compression support, disabled by default. Inverse ofSSL_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 ofSSL_OP_DONT_INSERT_EMPTY_FRAGMENTS.Bugsโ enable various bug workarounds. Same asSSL_OP_ALL.DHSingleโ enable single use DH keys, set by default. Inverse ofSSL_OP_DH_SINGLE. Only used by servers.ECDHSingleโ enable single use ECDH keys, set by default. Inverse ofSSL_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 toSSL_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 toSSL_OP_PRIORITIZE_CHACHA. Only used by servers.NoResumptionOnRenegotiationโ set theSSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATIONflag. Only used by servers.NoRenegotiationโ disables all attempts at renegotiation in TLSv1.2 and earlier, same as settingSSL_OP_NO_RENEGOTIATION.UnsafeLegacyRenegotiationโ permits the use of unsafe legacy renegotiation. Equivalent toSSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION.UnsafeLegacyServerConnectโ permits the use of unsafe legacy renegotiation for OpenSSL clients only. Equivalent toSSL_OP_LEGACY_SERVER_CONNECT.EncryptThenMacโ use encrypt-then-mac extension, enabled by default. Inverse ofSSL_OP_NO_ENCRYPT_THEN_MAC, that is,-EncryptThenMacis the same as settingSSL_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 toSSL_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. RequiresAllowNoDHEKEX. Equivalent toSSL_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 toSSL_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 settingSSL_OP_NO_ANTI_REPLAY.ExtendedMasterSecretโ use extended master secret extension, enabled by default. Inverse ofSSL_OP_NO_EXTENDED_MASTER_SECRET, that is,-ExtendedMasterSecretis the same as settingSSL_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 ofSSL_OP_DISABLE_TLSEXT_CA_NAMES, that is,-CANamesis the same as settingSSL_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 toSSL_OP_ENABLE_KTLS.StrictCertCheckโ enable strict certificate checking. Equivalent to settingSSL_CERT_FLAG_TLS_STRICTwithSSL_CTX_set_cert_flags().TxCertificateCompressionโ support sending compressed certificates, enabled by default. Inverse ofSSL_OP_NO_TX_CERTIFICATE_COMPRESSION, that is,-TxCertificateCompressionis the same as settingSSL_OP_NO_TX_CERTIFICATE_COMPRESSION.RxCertificateCompressionโ support receiving compressed certificates, enabled by default. Inverse ofSSL_OP_NO_RX_CERTIFICATE_COMPRESSION, that is,-RxCertificateCompressionis the same as settingSSL_OP_NO_RX_CERTIFICATE_COMPRESSION.KTLSTxZerocopySendfileโ use the zerocopy TX mode ofsendfile(), 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 toSSL_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 toSSL_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 isNULL. ๐ญ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 ๐ฆ
ssl(7)SSL_CONF_CTX_new(3)SSL_CONF_CTX_set_flags(3)SSL_CONF_CTX_set1_prefix(3)SSL_CONF_CTX_set_ssl_ctx(3)SSL_CONF_cmd_argv(3)SSL_CTX_set_options(3)
๐ HISTORY ๐
the lore, bestie, in chronological order ๐:
- The
SSL_CONF_cmd()function was added in OpenSSL 1.0.2. ๐ - The
SSL_OP_NO_SSL2option 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_NONEwas added in OpenSSL 1.1.0. In earlier versions of OpenSSL, passing a command which didn't take an argument would returnSSL_CONF_TYPE_UNKNOWN. ๐ญ MinProtocolandMaxProtocolwhere added in OpenSSL 1.1.0.AllowNoDHEKEXandPrioritizeChaChawere added in OpenSSL 1.1.1.- The
UnsafeLegacyServerConnectoption is no longer set by default from OpenSSL 3.0. - The
TxCertificateCompressionandRxCertificateCompressionoptions were added in OpenSSL 3.2. PreferNoDHEKEXwas 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 ๐
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
- fedora 43: openssl-devel 1:3.5.9-1.fc43 ยท Apache-2.0
- fedora 43: openssl-devel 1:3.5.9-1.fc43 ยท Apache-2.0
- fedora 44: openssl-devel 1:3.5.9-1.fc44 ยท Apache-2.0
- fedora 44: openssl-devel 1:3.5.9-1.fc44 ยท Apache-2.0
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms