1 1.1 christos =pod 2 1.1 christos 3 1.1 christos =head1 NAME 4 1.1 christos 5 1.1 christos SSL_CONF_cmd_value_type, 6 1.1 christos SSL_CONF_cmd - send configuration command 7 1.1 christos 8 1.1 christos =head1 SYNOPSIS 9 1.1 christos 10 1.1 christos #include <openssl/ssl.h> 11 1.1 christos 12 1.1.1.6 christos int SSL_CONF_cmd(SSL_CONF_CTX *ctx, const char *option, const char *value); 13 1.1.1.6 christos int SSL_CONF_cmd_value_type(SSL_CONF_CTX *ctx, const char *option); 14 1.1 christos 15 1.1 christos =head1 DESCRIPTION 16 1.1 christos 17 1.1.1.6 christos The function SSL_CONF_cmd() performs configuration operation B<option> with 18 1.1 christos optional parameter B<value> on B<ctx>. Its purpose is to simplify application 19 1.1 christos configuration of B<SSL_CTX> or B<SSL> structures by providing a common 20 1.1 christos framework for command line options or configuration files. 21 1.1 christos 22 1.1.1.6 christos SSL_CONF_cmd_value_type() returns the type of value that B<option> refers to. 23 1.1 christos 24 1.1 christos =head1 SUPPORTED COMMAND LINE COMMANDS 25 1.1 christos 26 1.1.1.6 christos Currently supported B<option> names for command lines (i.e. when the 27 1.1.1.6 christos flag B<SSL_CONF_FLAG_CMDLINE> is set) are listed below. Note: all B<option> 28 1.1.1.6 christos names are case sensitive. Unless otherwise stated commands can be used by 29 1.1 christos both clients and servers and the B<value> parameter is not used. The default 30 1.1 christos prefix for command line commands is B<-> and that is reflected below. 31 1.1 christos 32 1.1 christos =over 4 33 1.1 christos 34 1.1.1.6 christos =item B<-bugs> 35 1.1 christos 36 1.1.1.6 christos Various bug workarounds are set, same as setting B<SSL_OP_ALL>. 37 1.1 christos 38 1.1.1.6 christos =item B<-no_comp> 39 1.1 christos 40 1.1.1.6 christos Disables support for SSL/TLS compression, same as setting 41 1.1.1.6 christos B<SSL_OP_NO_COMPRESSION>. 42 1.1.1.6 christos As of OpenSSL 1.1.0, compression is off by default. 43 1.1 christos 44 1.1.1.6 christos =item B<-comp> 45 1.1 christos 46 1.1.1.6 christos Enables support for SSL/TLS compression, same as clearing 47 1.1.1.6 christos B<SSL_OP_NO_COMPRESSION>. 48 1.1.1.6 christos This command was introduced in OpenSSL 1.1.0. 49 1.1.1.6 christos As of OpenSSL 1.1.0, compression is off by default. 50 1.1 christos 51 1.1.1.6 christos =item B<-no_ticket> 52 1.1 christos 53 1.1.1.6 christos Disables support for session tickets, same as setting B<SSL_OP_NO_TICKET>. 54 1.1 christos 55 1.1.1.6 christos =item B<-serverpref> 56 1.1 christos 57 1.1.1.6 christos Use server and not client preference order when determining which cipher suite, 58 1.1.1.6 christos signature algorithm or elliptic curve to use for an incoming connection. 59 1.1.1.6 christos Equivalent to B<SSL_OP_CIPHER_SERVER_PREFERENCE>. Only used by servers. 60 1.1 christos 61 1.1.1.6 christos =item B<-client_renegotiation> 62 1.1 christos 63 1.1.1.6 christos Allows servers to accept client-initiated renegotiation. Equivalent to 64 1.1.1.6 christos setting B<SSL_OP_ALLOW_CLIENT_RENEGOTIATION>. 65 1.1.1.6 christos Only used by servers. 66 1.1 christos 67 1.1.1.6 christos =item B<-legacy_renegotiation> 68 1.1 christos 69 1.1.1.6 christos Permits the use of unsafe legacy renegotiation. Equivalent to setting 70 1.1.1.6 christos B<SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION>. 71 1.1 christos 72 1.1.1.6 christos =item B<-no_renegotiation> 73 1.1 christos 74 1.1.1.6 christos Disables all attempts at renegotiation in TLSv1.2 and earlier, same as setting 75 1.1.1.6 christos B<SSL_OP_NO_RENEGOTIATION>. 76 1.1 christos 77 1.1.1.6 christos =item B<-no_resumption_on_reneg> 78 1.1 christos 79 1.1.1.6 christos Sets B<SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION>. Only used by servers. 80 1.1 christos 81 1.1.1.6 christos =item B<-legacy_server_connect>, B<-no_legacy_server_connect> 82 1.1 christos 83 1.1.1.6 christos Permits or prohibits the use of unsafe legacy renegotiation for OpenSSL 84 1.1.1.6 christos clients only. Equivalent to setting or clearing B<SSL_OP_LEGACY_SERVER_CONNECT>. 85 1.1 christos 86 1.1.1.6 christos =item B<-prioritize_chacha> 87 1.1 christos 88 1.1.1.6 christos Prioritize ChaCha ciphers when the client has a ChaCha20 cipher at the top of 89 1.1.1.6 christos its preference list. This usually indicates a client without AES hardware 90 1.1.1.6 christos acceleration (e.g. mobile) is in use. Equivalent to B<SSL_OP_PRIORITIZE_CHACHA>. 91 1.1.1.6 christos Only used by servers. Requires B<-serverpref>. 92 1.1 christos 93 1.1.1.6 christos =item B<-allow_no_dhe_kex> 94 1.1 christos 95 1.1.1.6 christos In TLSv1.3 allow a non-(ec)dhe based key exchange mode on resumption. This means 96 1.1.1.6 christos that there will be no forward secrecy for the resumed session. 97 1.1 christos 98 1.1.1.6 christos =item B<-strict> 99 1.1 christos 100 1.1.1.6 christos Enables strict mode protocol handling. Equivalent to setting 101 1.1.1.6 christos B<SSL_CERT_FLAG_TLS_STRICT>. 102 1.1 christos 103 1.1.1.6 christos =item B<-sigalgs> I<algs> 104 1.1.1.6 christos 105 1.1.1.6 christos This sets the supported signature algorithms for TLSv1.2 and TLSv1.3. 106 1.1.1.6 christos For clients this value is used directly for the supported signature 107 1.1.1.6 christos algorithms extension. For servers it is used to determine which signature 108 1.1.1.6 christos algorithms to support. 109 1.1.1.6 christos 110 1.1.1.6 christos The B<algs> argument should be a colon separated list of signature 111 1.1.1.6 christos algorithms in order of decreasing preference of the form B<algorithm+hash> 112 1.1.1.6 christos or B<signature_scheme>. B<algorithm> is one of B<RSA>, B<DSA> or B<ECDSA> and 113 1.1.1.6 christos B<hash> is a supported algorithm OID short name such as B<SHA1>, B<SHA224>, 114 1.1.1.6 christos B<SHA256>, B<SHA384> of B<SHA512>. Note: algorithm and hash names are case 115 1.1.1.6 christos sensitive. B<signature_scheme> is one of the signature schemes defined in 116 1.1.1.6 christos TLSv1.3, specified using the IETF name, e.g., B<ecdsa_secp256r1_sha256>, 117 1.1.1.6 christos B<ed25519>, or B<rsa_pss_pss_sha256>. 118 1.1 christos 119 1.1.1.6 christos If this option is not set then all signature algorithms supported by the 120 1.1.1.6 christos OpenSSL library are permissible. 121 1.1 christos 122 1.1.1.6 christos Note: algorithms which specify a PKCS#1 v1.5 signature scheme (either by 123 1.1.1.6 christos using B<RSA> as the B<algorithm> or by using one of the B<rsa_pkcs1_*> 124 1.1.1.6 christos identifiers) are ignored in TLSv1.3 and will not be negotiated. 125 1.1 christos 126 1.1.1.6 christos =item B<-client_sigalgs> I<algs> 127 1.1 christos 128 1.1.1.6 christos This sets the supported signature algorithms associated with client 129 1.1.1.6 christos authentication for TLSv1.2 and TLSv1.3. For servers the B<algs> is used 130 1.1.1.6 christos in the B<signature_algorithms> field of a B<CertificateRequest> message. 131 1.1.1.6 christos For clients it is used to determine which signature algorithm to use with 132 1.1.1.6 christos the client certificate. If a server does not request a certificate this 133 1.1.1.6 christos option has no effect. 134 1.1.1.6 christos 135 1.1.1.6 christos The syntax of B<algs> is identical to B<-sigalgs>. If not set, then the 136 1.1.1.6 christos value set for B<-sigalgs> will be used instead. 137 1.1.1.6 christos 138 1.1.1.6 christos =item B<-groups> I<groups> 139 1.1.1.6 christos 140 1.1.1.6 christos This sets the supported groups. For clients, the groups are sent using 141 1.1.1.6 christos the supported groups extension. For servers, it is used to determine which 142 1.1.1.6 christos group to use. This setting affects groups used for signatures (in TLSv1.2 143 1.1.1.6 christos and earlier) and key exchange. The first group listed will also be used 144 1.1.1.6 christos for the B<key_share> sent by a client in a TLSv1.3 B<ClientHello>. 145 1.1.1.6 christos 146 1.1.1.6 christos The B<groups> argument is a colon separated list of groups. The group can 147 1.1.1.6 christos be either the B<NIST> name (e.g. B<P-256>), some other commonly used name 148 1.1.1.6 christos where applicable (e.g. B<X25519>, B<ffdhe2048>) or an OpenSSL OID name 149 1.1.1.6 christos (e.g. B<prime256v1>). Group names are case sensitive. The list should be 150 1.1.1.6 christos in order of preference with the most preferred group first. 151 1.1.1.6 christos 152 1.1.1.6 christos Currently supported groups for B<TLSv1.3> are B<P-256>, B<P-384>, B<P-521>, 153 1.1.1.6 christos B<X25519>, B<X448>, B<ffdhe2048>, B<ffdhe3072>, B<ffdhe4096>, B<ffdhe6144>, 154 1.1.1.6 christos B<ffdhe8192>. 155 1.1.1.6 christos 156 1.1.1.6 christos =item B<-curves> I<groups> 157 1.1.1.6 christos 158 1.1.1.6 christos This is a synonym for the B<-groups> command. 159 1.1.1.6 christos 160 1.1.1.6 christos =item B<-named_curve> I<curve> 161 1.1 christos 162 1.1.1.6 christos This sets the temporary curve used for ephemeral ECDH modes. Only used 163 1.1.1.6 christos by servers. 164 1.1.1.6 christos 165 1.1.1.6 christos The B<groups> argument is a curve name or the special value B<auto> which 166 1.1.1.6 christos picks an appropriate curve based on client and server preferences. The 167 1.1.1.6 christos curve can be either the B<NIST> name (e.g. B<P-256>) or an OpenSSL OID name 168 1.1.1.6 christos (e.g. B<prime256v1>). Curve names are case sensitive. 169 1.1.1.6 christos 170 1.1.1.6 christos =item B<-cipher> I<ciphers> 171 1.1.1.6 christos 172 1.1.1.6 christos Sets the TLSv1.2 and below ciphersuite list to B<ciphers>. This list will be 173 1.1.1.6 christos combined with any configured TLSv1.3 ciphersuites. Note: syntax checking 174 1.1.1.6 christos of B<ciphers> is currently not performed unless a B<SSL> or B<SSL_CTX> 175 1.1.1.6 christos structure is associated with B<ctx>. 176 1.1.1.6 christos 177 1.1.1.6 christos =item B<-ciphersuites> I<1.3ciphers> 178 1.1.1.6 christos 179 1.1.1.6 christos Sets the available ciphersuites for TLSv1.3 to value. This is a 180 1.1.1.6 christos colon-separated list of TLSv1.3 ciphersuite names in order of preference. This 181 1.1.1.6 christos list will be combined any configured TLSv1.2 and below ciphersuites. 182 1.1.1.6 christos See L<openssl-ciphers(1)> for more information. 183 1.1.1.6 christos 184 1.1.1.6 christos =item B<-min_protocol> I<minprot>, B<-max_protocol> I<maxprot> 185 1.1 christos 186 1.1 christos Sets the minimum and maximum supported protocol. 187 1.1.1.4 christos Currently supported protocol values are B<SSLv3>, B<TLSv1>, B<TLSv1.1>, 188 1.1.1.4 christos B<TLSv1.2>, B<TLSv1.3> for TLS; B<DTLSv1>, B<DTLSv1.2> for DTLS, and B<None> 189 1.1.1.4 christos for no limit. 190 1.1.1.4 christos If either the lower or upper bound is not specified then only the other bound 191 1.1.1.4 christos applies, if specified. 192 1.1.1.4 christos If your application supports both TLS and DTLS you can specify any of these 193 1.1.1.4 christos options twice, once with a bound for TLS and again with an appropriate bound 194 1.1.1.4 christos for DTLS. 195 1.1.1.4 christos To restrict the supported protocol versions use these commands rather than the 196 1.1.1.4 christos deprecated alternative commands below. 197 1.1 christos 198 1.1.1.6 christos =item B<-record_padding> I<padding> 199 1.1 christos 200 1.1.1.6 christos Attempts to pad TLSv1.3 records so that they are a multiple of B<padding> 201 1.1.1.6 christos in length on send. A B<padding> of 0 or 1 turns off padding. Otherwise, 202 1.1.1.6 christos the B<padding> must be >1 or <=16384. 203 1.1 christos 204 1.1.1.6 christos =item B<-debug_broken_protocol> 205 1.1 christos 206 1.1.1.6 christos Ignored. 207 1.1 christos 208 1.1.1.6 christos =item B<-no_middlebox> 209 1.1 christos 210 1.1.1.6 christos Turn off "middlebox compatibility", as described below. 211 1.1 christos 212 1.1.1.6 christos =back 213 1.1 christos 214 1.1.1.6 christos =head2 Additional Options 215 1.1 christos 216 1.1.1.6 christos The following options are accepted by SSL_CONF_cmd(), but are not 217 1.1.1.6 christos processed by the OpenSSL commands. 218 1.1 christos 219 1.1.1.6 christos =over 4 220 1.1 christos 221 1.1.1.6 christos =item B<-cert> I<file> 222 1.1 christos 223 1.1.1.6 christos Attempts to use B<file> as the certificate for the appropriate context. It 224 1.1.1.6 christos currently uses SSL_CTX_use_certificate_chain_file() if an B<SSL_CTX> 225 1.1.1.6 christos structure is set or SSL_use_certificate_file() with filetype PEM if an 226 1.1.1.6 christos B<SSL> structure is set. This option is only supported if certificate 227 1.1.1.6 christos operations are permitted. 228 1.1 christos 229 1.1.1.6 christos =item B<-key> I<file> 230 1.1 christos 231 1.1.1.6 christos Attempts to use B<file> as the private key for the appropriate context. This 232 1.1.1.6 christos option is only supported if certificate operations are permitted. Note: 233 1.1.1.6 christos if no B<-key> option is set then a private key is not loaded unless the 234 1.1.1.6 christos flag B<SSL_CONF_FLAG_REQUIRE_PRIVATE> is set. 235 1.1 christos 236 1.1.1.6 christos =item B<-dhparam> I<file> 237 1.1 christos 238 1.1.1.6 christos Attempts to use B<file> as the set of temporary DH parameters for 239 1.1.1.6 christos the appropriate context. This option is only supported if certificate 240 1.1.1.6 christos operations are permitted. 241 1.1 christos 242 1.1.1.6 christos =item B<-no_ssl3>, B<-no_tls1>, B<-no_tls1_1>, B<-no_tls1_2>, B<-no_tls1_3> 243 1.1 christos 244 1.1.1.6 christos Disables protocol support for SSLv3, TLSv1.0, TLSv1.1, TLSv1.2 or TLSv1.3 by 245 1.1.1.6 christos setting the corresponding options B<SSL_OP_NO_SSLv3>, B<SSL_OP_NO_TLSv1>, 246 1.1.1.6 christos B<SSL_OP_NO_TLSv1_1>, B<SSL_OP_NO_TLSv1_2> and B<SSL_OP_NO_TLSv1_3> 247 1.1.1.6 christos respectively. These options are deprecated, use B<-min_protocol> and 248 1.1.1.6 christos B<-max_protocol> instead. 249 1.1 christos 250 1.1 christos =item B<-anti_replay>, B<-no_anti_replay> 251 1.1 christos 252 1.1 christos Switches replay protection, on or off respectively. With replay protection on, 253 1.1 christos OpenSSL will automatically detect if a session ticket has been used more than 254 1.1 christos once, TLSv1.3 has been negotiated, and early data is enabled on the server. A 255 1.1 christos full handshake is forced if a session ticket is used a second or subsequent 256 1.1 christos time. Anti-Replay is on by default unless overridden by a configuration file and 257 1.1 christos is only used by servers. Anti-replay measures are required for compliance with 258 1.1 christos the TLSv1.3 specification. Some applications may be able to mitigate the replay 259 1.1 christos risks in other ways and in such cases the built-in OpenSSL functionality is not 260 1.1 christos required. Switching off anti-replay is equivalent to B<SSL_OP_NO_ANTI_REPLAY>. 261 1.1 christos 262 1.1 christos =back 263 1.1 christos 264 1.1 christos =head1 SUPPORTED CONFIGURATION FILE COMMANDS 265 1.1 christos 266 1.1.1.6 christos Currently supported B<option> names for configuration files (i.e., when the 267 1.1 christos flag B<SSL_CONF_FLAG_FILE> is set) are listed below. All configuration file 268 1.1.1.6 christos B<option> names are case insensitive so B<signaturealgorithms> is recognised 269 1.1 christos as well as B<SignatureAlgorithms>. Unless otherwise stated the B<value> names 270 1.1 christos are also case insensitive. 271 1.1 christos 272 1.1.1.6 christos Note: the command prefix (if set) alters the recognised B<option> values. 273 1.1 christos 274 1.1 christos =over 4 275 1.1 christos 276 1.1 christos =item B<CipherString> 277 1.1 christos 278 1.1 christos Sets the ciphersuite list for TLSv1.2 and below to B<value>. This list will be 279 1.1 christos combined with any configured TLSv1.3 ciphersuites. Note: syntax 280 1.1 christos checking of B<value> is currently not performed unless an B<SSL> or B<SSL_CTX> 281 1.1.1.6 christos structure is associated with B<ctx>. 282 1.1 christos 283 1.1 christos =item B<Ciphersuites> 284 1.1 christos 285 1.1.1.6 christos Sets the available ciphersuites for TLSv1.3 to B<value>. This is a 286 1.1.1.6 christos colon-separated list of TLSv1.3 ciphersuite names in order of preference. This 287 1.1 christos list will be combined any configured TLSv1.2 and below ciphersuites. 288 1.1.1.6 christos See L<openssl-ciphers(1)> for more information. 289 1.1 christos 290 1.1 christos =item B<Certificate> 291 1.1 christos 292 1.1 christos Attempts to use the file B<value> as the certificate for the appropriate 293 1.1 christos context. It currently uses SSL_CTX_use_certificate_chain_file() if an B<SSL_CTX> 294 1.1 christos structure is set or SSL_use_certificate_file() with filetype PEM if an B<SSL> 295 1.1 christos structure is set. This option is only supported if certificate operations 296 1.1 christos are permitted. 297 1.1 christos 298 1.1 christos =item B<PrivateKey> 299 1.1 christos 300 1.1 christos Attempts to use the file B<value> as the private key for the appropriate 301 1.1 christos context. This option is only supported if certificate operations 302 1.1 christos are permitted. Note: if no B<PrivateKey> option is set then a private key is 303 1.1 christos not loaded unless the B<SSL_CONF_FLAG_REQUIRE_PRIVATE> is set. 304 1.1 christos 305 1.1 christos =item B<ChainCAFile>, B<ChainCAPath>, B<VerifyCAFile>, B<VerifyCAPath> 306 1.1 christos 307 1.1 christos These options indicate a file or directory used for building certificate 308 1.1 christos chains or verifying certificate chains. These options are only supported 309 1.1 christos if certificate operations are permitted. 310 1.1 christos 311 1.1 christos =item B<RequestCAFile> 312 1.1 christos 313 1.1 christos This option indicates a file containing a set of certificates in PEM form. 314 1.1 christos The subject names of the certificates are sent to the peer in the 315 1.1 christos B<certificate_authorities> extension for TLS 1.3 (in ClientHello or 316 1.1 christos CertificateRequest) or in a certificate request for previous versions or 317 1.1 christos TLS. 318 1.1 christos 319 1.1 christos =item B<ServerInfoFile> 320 1.1 christos 321 1.1 christos Attempts to use the file B<value> in the "serverinfo" extension using the 322 1.1 christos function SSL_CTX_use_serverinfo_file. 323 1.1 christos 324 1.1 christos =item B<DHParameters> 325 1.1 christos 326 1.1 christos Attempts to use the file B<value> as the set of temporary DH parameters for 327 1.1 christos the appropriate context. This option is only supported if certificate 328 1.1 christos operations are permitted. 329 1.1 christos 330 1.1 christos =item B<RecordPadding> 331 1.1 christos 332 1.1 christos Attempts to pad TLSv1.3 records so that they are a multiple of B<value> in 333 1.1 christos length on send. A B<value> of 0 or 1 turns off padding. Otherwise, the 334 1.1 christos B<value> must be >1 or <=16384. 335 1.1 christos 336 1.1 christos =item B<SignatureAlgorithms> 337 1.1 christos 338 1.1 christos This sets the supported signature algorithms for TLSv1.2 and TLSv1.3. 339 1.1 christos For clients this 340 1.1 christos value is used directly for the supported signature algorithms extension. For 341 1.1 christos servers it is used to determine which signature algorithms to support. 342 1.1 christos 343 1.1 christos The B<value> argument should be a colon separated list of signature algorithms 344 1.1 christos in order of decreasing preference of the form B<algorithm+hash> or 345 1.1 christos B<signature_scheme>. B<algorithm> 346 1.1 christos is one of B<RSA>, B<DSA> or B<ECDSA> and B<hash> is a supported algorithm 347 1.1 christos OID short name such as B<SHA1>, B<SHA224>, B<SHA256>, B<SHA384> of B<SHA512>. 348 1.1 christos Note: algorithm and hash names are case sensitive. 349 1.1 christos B<signature_scheme> is one of the signature schemes defined in TLSv1.3, 350 1.1 christos specified using the IETF name, e.g., B<ecdsa_secp256r1_sha256>, B<ed25519>, 351 1.1 christos or B<rsa_pss_pss_sha256>. 352 1.1 christos 353 1.1 christos If this option is not set then all signature algorithms supported by the 354 1.1 christos OpenSSL library are permissible. 355 1.1 christos 356 1.1 christos Note: algorithms which specify a PKCS#1 v1.5 signature scheme (either by 357 1.1 christos using B<RSA> as the B<algorithm> or by using one of the B<rsa_pkcs1_*> 358 1.1 christos identifiers) are ignored in TLSv1.3 and will not be negotiated. 359 1.1 christos 360 1.1 christos =item B<ClientSignatureAlgorithms> 361 1.1 christos 362 1.1 christos This sets the supported signature algorithms associated with client 363 1.1 christos authentication for TLSv1.2 and TLSv1.3. 364 1.1 christos For servers the value is used in the 365 1.1 christos B<signature_algorithms> field of a B<CertificateRequest> message. 366 1.1 christos For clients it is 367 1.1 christos used to determine which signature algorithm to use with the client certificate. 368 1.1 christos If a server does not request a certificate this option has no effect. 369 1.1 christos 370 1.1 christos The syntax of B<value> is identical to B<SignatureAlgorithms>. If not set then 371 1.1 christos the value set for B<SignatureAlgorithms> will be used instead. 372 1.1 christos 373 1.1 christos =item B<Groups> 374 1.1 christos 375 1.1 christos This sets the supported groups. For clients, the groups are 376 1.1 christos sent using the supported groups extension. For servers, it is used 377 1.1 christos to determine which group to use. This setting affects groups used for 378 1.1 christos signatures (in TLSv1.2 and earlier) and key exchange. The first group listed 379 1.1 christos will also be used for the B<key_share> sent by a client in a TLSv1.3 380 1.1 christos B<ClientHello>. 381 1.1 christos 382 1.1 christos The B<value> argument is a colon separated list of groups. The group can be 383 1.1 christos either the B<NIST> name (e.g. B<P-256>), some other commonly used name where 384 1.1.1.6 christos applicable (e.g. B<X25519>, B<ffdhe2048>) or an OpenSSL OID name 385 1.1.1.6 christos (e.g. B<prime256v1>). Group names are case sensitive. The list should be in 386 1.1.1.6 christos order of preference with the most preferred group first. 387 1.1.1.6 christos 388 1.1.1.6 christos Currently supported groups for B<TLSv1.3> are B<P-256>, B<P-384>, B<P-521>, 389 1.1.1.6 christos B<X25519>, B<X448>, B<ffdhe2048>, B<ffdhe3072>, B<ffdhe4096>, B<ffdhe6144>, 390 1.1.1.6 christos B<ffdhe8192>. 391 1.1 christos 392 1.1 christos =item B<Curves> 393 1.1 christos 394 1.1 christos This is a synonym for the "Groups" command. 395 1.1 christos 396 1.1 christos =item B<MinProtocol> 397 1.1 christos 398 1.1 christos This sets the minimum supported SSL, TLS or DTLS version. 399 1.1 christos 400 1.1 christos Currently supported protocol values are B<SSLv3>, B<TLSv1>, B<TLSv1.1>, 401 1.1 christos B<TLSv1.2>, B<TLSv1.3>, B<DTLSv1> and B<DTLSv1.2>. 402 1.1.1.4 christos The SSL and TLS bounds apply only to TLS-based contexts, while the DTLS bounds 403 1.1.1.4 christos apply only to DTLS-based contexts. 404 1.1.1.4 christos The command can be repeated with one instance setting a TLS bound, and the 405 1.1.1.4 christos other setting a DTLS bound. 406 1.1.1.4 christos The value B<None> applies to both types of contexts and disables the limits. 407 1.1 christos 408 1.1 christos =item B<MaxProtocol> 409 1.1 christos 410 1.1 christos This sets the maximum supported SSL, TLS or DTLS version. 411 1.1 christos 412 1.1 christos Currently supported protocol values are B<SSLv3>, B<TLSv1>, B<TLSv1.1>, 413 1.1 christos B<TLSv1.2>, B<TLSv1.3>, B<DTLSv1> and B<DTLSv1.2>. 414 1.1.1.4 christos The SSL and TLS bounds apply only to TLS-based contexts, while the DTLS bounds 415 1.1.1.4 christos apply only to DTLS-based contexts. 416 1.1.1.4 christos The command can be repeated with one instance setting a TLS bound, and the 417 1.1.1.4 christos other setting a DTLS bound. 418 1.1.1.4 christos The value B<None> applies to both types of contexts and disables the limits. 419 1.1 christos 420 1.1 christos =item B<Protocol> 421 1.1 christos 422 1.1 christos This can be used to enable or disable certain versions of the SSL, 423 1.1 christos TLS or DTLS protocol. 424 1.1 christos 425 1.1 christos The B<value> argument is a comma separated list of supported protocols 426 1.1 christos to enable or disable. 427 1.1 christos If a protocol is preceded by B<-> that version is disabled. 428 1.1 christos 429 1.1 christos All protocol versions are enabled by default. 430 1.1 christos You need to disable at least one protocol version for this setting have any 431 1.1 christos effect. 432 1.1 christos Only enabling some protocol versions does not disable the other protocol 433 1.1 christos versions. 434 1.1 christos 435 1.1 christos Currently supported protocol values are B<SSLv3>, B<TLSv1>, B<TLSv1.1>, 436 1.1 christos B<TLSv1.2>, B<TLSv1.3>, B<DTLSv1> and B<DTLSv1.2>. 437 1.1 christos The special value B<ALL> refers to all supported versions. 438 1.1 christos 439 1.1 christos This can't enable protocols that are disabled using B<MinProtocol> 440 1.1 christos or B<MaxProtocol>, but can disable protocols that are still allowed 441 1.1 christos by them. 442 1.1 christos 443 1.1 christos The B<Protocol> command is fragile and deprecated; do not use it. 444 1.1 christos Use B<MinProtocol> and B<MaxProtocol> instead. 445 1.1 christos If you do use B<Protocol>, make sure that the resulting range of enabled 446 1.1 christos protocols has no "holes", e.g. if TLS 1.0 and TLS 1.2 are both enabled, make 447 1.1 christos sure to also leave TLS 1.1 enabled. 448 1.1 christos 449 1.1 christos =item B<Options> 450 1.1 christos 451 1.1 christos The B<value> argument is a comma separated list of various flags to set. 452 1.1 christos If a flag string is preceded B<-> it is disabled. 453 1.1 christos See the L<SSL_CTX_set_options(3)> function for more details of 454 1.1 christos individual options. 455 1.1 christos 456 1.1 christos Each option is listed below. Where an operation is enabled by default 457 1.1 christos the B<-flag> syntax is needed to disable it. 458 1.1 christos 459 1.1 christos B<SessionTicket>: session ticket support, enabled by default. Inverse of 460 1.1 christos B<SSL_OP_NO_TICKET>: that is B<-SessionTicket> is the same as setting 461 1.1 christos B<SSL_OP_NO_TICKET>. 462 1.1 christos 463 1.1.1.5 christos B<Compression>: SSL/TLS compression support, disabled by default. Inverse 464 1.1 christos of B<SSL_OP_NO_COMPRESSION>. 465 1.1 christos 466 1.1 christos B<EmptyFragments>: use empty fragments as a countermeasure against a 467 1.1 christos SSL 3.0/TLS 1.0 protocol vulnerability affecting CBC ciphers. It 468 1.1 christos is set by default. Inverse of B<SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS>. 469 1.1 christos 470 1.1 christos B<Bugs>: enable various bug workarounds. Same as B<SSL_OP_ALL>. 471 1.1 christos 472 1.1 christos B<DHSingle>: enable single use DH keys, set by default. Inverse of 473 1.1 christos B<SSL_OP_DH_SINGLE>. Only used by servers. 474 1.1 christos 475 1.1 christos B<ECDHSingle>: enable single use ECDH keys, set by default. Inverse of 476 1.1 christos B<SSL_OP_ECDH_SINGLE>. Only used by servers. 477 1.1 christos 478 1.1 christos B<ServerPreference>: use server and not client preference order when 479 1.1 christos determining which cipher suite, signature algorithm or elliptic curve 480 1.1 christos to use for an incoming connection. Equivalent to 481 1.1 christos B<SSL_OP_CIPHER_SERVER_PREFERENCE>. Only used by servers. 482 1.1 christos 483 1.1 christos B<PrioritizeChaCha>: prioritizes ChaCha ciphers when the client has a 484 1.1 christos ChaCha20 cipher at the top of its preference list. This usually indicates 485 1.1 christos a mobile client is in use. Equivalent to B<SSL_OP_PRIORITIZE_CHACHA>. 486 1.1 christos Only used by servers. 487 1.1 christos 488 1.1 christos B<NoResumptionOnRenegotiation>: set 489 1.1 christos B<SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION> flag. Only used by servers. 490 1.1 christos 491 1.1.1.2 christos B<NoRenegotiation>: disables all attempts at renegotiation in TLSv1.2 and 492 1.1.1.2 christos earlier, same as setting B<SSL_OP_NO_RENEGOTIATION>. 493 1.1.1.2 christos 494 1.1 christos B<UnsafeLegacyRenegotiation>: permits the use of unsafe legacy renegotiation. 495 1.1 christos Equivalent to B<SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION>. 496 1.1 christos 497 1.1 christos B<UnsafeLegacyServerConnect>: permits the use of unsafe legacy renegotiation 498 1.1 christos for OpenSSL clients only. Equivalent to B<SSL_OP_LEGACY_SERVER_CONNECT>. 499 1.1 christos 500 1.1 christos B<EncryptThenMac>: use encrypt-then-mac extension, enabled by 501 1.1 christos default. Inverse of B<SSL_OP_NO_ENCRYPT_THEN_MAC>: that is, 502 1.1 christos B<-EncryptThenMac> is the same as setting B<SSL_OP_NO_ENCRYPT_THEN_MAC>. 503 1.1 christos 504 1.1 christos B<AllowNoDHEKEX>: In TLSv1.3 allow a non-(ec)dhe based key exchange mode on 505 1.1 christos resumption. This means that there will be no forward secrecy for the resumed 506 1.1 christos session. Equivalent to B<SSL_OP_ALLOW_NO_DHE_KEX>. 507 1.1 christos 508 1.1 christos B<MiddleboxCompat>: If set then dummy Change Cipher Spec (CCS) messages are sent 509 1.1 christos in TLSv1.3. This has the effect of making TLSv1.3 look more like TLSv1.2 so that 510 1.1 christos middleboxes that do not understand TLSv1.3 will not drop the connection. This 511 1.1 christos option is set by default. A future version of OpenSSL may not set this by 512 1.1 christos default. Equivalent to B<SSL_OP_ENABLE_MIDDLEBOX_COMPAT>. 513 1.1 christos 514 1.1 christos B<AntiReplay>: If set then OpenSSL will automatically detect if a session ticket 515 1.1 christos has been used more than once, TLSv1.3 has been negotiated, and early data is 516 1.1 christos enabled on the server. A full handshake is forced if a session ticket is used a 517 1.1 christos second or subsequent time. This option is set by default and is only used by 518 1.1 christos servers. Anti-replay measures are required to comply with the TLSv1.3 519 1.1 christos specification. Some applications may be able to mitigate the replay risks in 520 1.1 christos other ways and in such cases the built-in OpenSSL functionality is not required. 521 1.1 christos Disabling anti-replay is equivalent to setting B<SSL_OP_NO_ANTI_REPLAY>. 522 1.1 christos 523 1.1.1.6 christos B<ExtendedMasterSecret>: use extended master secret extension, enabled by 524 1.1.1.6 christos default. Inverse of B<SSL_OP_NO_EXTENDED_MASTER_SECRET>: that is, 525 1.1.1.6 christos B<-ExtendedMasterSecret> is the same as setting B<SSL_OP_NO_EXTENDED_MASTER_SECRET>. 526 1.1.1.6 christos 527 1.1.1.6 christos B<CANames>: use CA names extension, enabled by 528 1.1.1.6 christos default. Inverse of B<SSL_OP_DISABLE_TLSEXT_CA_NAMES>: that is, 529 1.1.1.6 christos B<-CANames> is the same as setting B<SSL_OP_DISABLE_TLSEXT_CA_NAMES>. 530 1.1.1.6 christos 531 1.1.1.6 christos B<KTLS>: Enables kernel TLS if support has been compiled in, and it is supported 532 1.1.1.6 christos by the negotiated ciphersuites and extensions. Equivalent to 533 1.1.1.6 christos B<SSL_OP_ENABLE_KTLS>. 534 1.1.1.6 christos 535 1.1 christos =item B<VerifyMode> 536 1.1 christos 537 1.1 christos The B<value> argument is a comma separated list of flags to set. 538 1.1 christos 539 1.1 christos B<Peer> enables peer verification: for clients only. 540 1.1 christos 541 1.1 christos B<Request> requests but does not require a certificate from the client. 542 1.1 christos Servers only. 543 1.1 christos 544 1.1 christos B<Require> requests and requires a certificate from the client: an error 545 1.1 christos occurs if the client does not present a certificate. Servers only. 546 1.1 christos 547 1.1 christos B<Once> requests a certificate from a client only on the initial connection: 548 1.1 christos not when renegotiating. Servers only. 549 1.1 christos 550 1.1 christos B<RequestPostHandshake> configures the connection to support requests but does 551 1.1 christos not require a certificate from the client post-handshake. A certificate will 552 1.1 christos not be requested during the initial handshake. The server application must 553 1.1 christos provide a mechanism to request a certificate post-handshake. Servers only. 554 1.1 christos TLSv1.3 only. 555 1.1 christos 556 1.1 christos B<RequiresPostHandshake> configures the connection to support requests and 557 1.1 christos requires a certificate from the client post-handshake: an error occurs if the 558 1.1 christos client does not present a certificate. A certificate will not be requested 559 1.1 christos during the initial handshake. The server application must provide a mechanism 560 1.1 christos to request a certificate post-handshake. Servers only. TLSv1.3 only. 561 1.1 christos 562 1.1 christos =item B<ClientCAFile>, B<ClientCAPath> 563 1.1 christos 564 1.1 christos A file or directory of certificates in PEM format whose names are used as the 565 1.1 christos set of acceptable names for client CAs. Servers only. This option is only 566 1.1 christos supported if certificate operations are permitted. 567 1.1 christos 568 1.1 christos =back 569 1.1 christos 570 1.1 christos =head1 SUPPORTED COMMAND TYPES 571 1.1 christos 572 1.1 christos The function SSL_CONF_cmd_value_type() currently returns one of the following 573 1.1 christos types: 574 1.1 christos 575 1.1 christos =over 4 576 1.1 christos 577 1.1 christos =item B<SSL_CONF_TYPE_UNKNOWN> 578 1.1 christos 579 1.1.1.6 christos The B<option> string is unrecognised, this return value can be use to flag 580 1.1 christos syntax errors. 581 1.1 christos 582 1.1 christos =item B<SSL_CONF_TYPE_STRING> 583 1.1 christos 584 1.1 christos The value is a string without any specific structure. 585 1.1 christos 586 1.1 christos =item B<SSL_CONF_TYPE_FILE> 587 1.1 christos 588 1.1.1.4 christos The value is a filename. 589 1.1 christos 590 1.1 christos =item B<SSL_CONF_TYPE_DIR> 591 1.1 christos 592 1.1 christos The value is a directory name. 593 1.1 christos 594 1.1 christos =item B<SSL_CONF_TYPE_NONE> 595 1.1 christos 596 1.1 christos The value string is not used e.g. a command line option which doesn't take an 597 1.1 christos argument. 598 1.1 christos 599 1.1 christos =back 600 1.1 christos 601 1.1 christos =head1 NOTES 602 1.1 christos 603 1.1 christos The order of operations is significant. This can be used to set either defaults 604 1.1 christos or values which cannot be overridden. For example if an application calls: 605 1.1 christos 606 1.1 christos SSL_CONF_cmd(ctx, "Protocol", "-SSLv3"); 607 1.1 christos SSL_CONF_cmd(ctx, userparam, uservalue); 608 1.1 christos 609 1.1 christos it will disable SSLv3 support by default but the user can override it. If 610 1.1 christos however the call sequence is: 611 1.1 christos 612 1.1 christos SSL_CONF_cmd(ctx, userparam, uservalue); 613 1.1 christos SSL_CONF_cmd(ctx, "Protocol", "-SSLv3"); 614 1.1 christos 615 1.1 christos SSLv3 is B<always> disabled and attempt to override this by the user are 616 1.1 christos ignored. 617 1.1 christos 618 1.1 christos By checking the return code of SSL_CONF_cmd() it is possible to query if a 619 1.1.1.6 christos given B<option> is recognised, this is useful if SSL_CONF_cmd() values are 620 1.1 christos mixed with additional application specific operations. 621 1.1 christos 622 1.1 christos For example an application might call SSL_CONF_cmd() and if it returns 623 1.1 christos -2 (unrecognised command) continue with processing of application specific 624 1.1 christos commands. 625 1.1 christos 626 1.1 christos Applications can also use SSL_CONF_cmd() to process command lines though the 627 1.1 christos utility function SSL_CONF_cmd_argv() is normally used instead. One way 628 1.1 christos to do this is to set the prefix to an appropriate value using 629 1.1.1.6 christos SSL_CONF_CTX_set1_prefix(), pass the current argument to B<option> and the 630 1.1 christos following argument to B<value> (which may be NULL). 631 1.1 christos 632 1.1 christos In this case if the return value is positive then it is used to skip that 633 1.1 christos number of arguments as they have been processed by SSL_CONF_cmd(). If -2 is 634 1.1.1.6 christos returned then B<option> is not recognised and application specific arguments 635 1.1 christos can be checked instead. If -3 is returned a required argument is missing 636 1.1 christos and an error is indicated. If 0 is returned some other error occurred and 637 1.1 christos this can be reported back to the user. 638 1.1 christos 639 1.1 christos The function SSL_CONF_cmd_value_type() can be used by applications to 640 1.1 christos check for the existence of a command or to perform additional syntax 641 1.1 christos checking or translation of the command value. For example if the return 642 1.1 christos value is B<SSL_CONF_TYPE_FILE> an application could translate a relative 643 1.1 christos pathname to an absolute pathname. 644 1.1 christos 645 1.1.1.3 christos =head1 RETURN VALUES 646 1.1.1.3 christos 647 1.1.1.6 christos SSL_CONF_cmd() returns 1 if the value of B<option> is recognised and B<value> is 648 1.1.1.6 christos B<NOT> used and 2 if both B<option> and B<value> are used. In other words it 649 1.1.1.3 christos returns the number of arguments processed. This is useful when processing 650 1.1.1.3 christos command lines. 651 1.1.1.3 christos 652 1.1.1.6 christos A return value of -2 means B<option> is not recognised. 653 1.1.1.3 christos 654 1.1.1.6 christos A return value of -3 means B<option> is recognised and the command requires a 655 1.1.1.3 christos value but B<value> is NULL. 656 1.1.1.3 christos 657 1.1.1.6 christos A return code of 0 indicates that both B<option> and B<value> are valid but an 658 1.1.1.3 christos error occurred attempting to perform the operation: for example due to an 659 1.1.1.3 christos error in the syntax of B<value> in this case the error queue may provide 660 1.1.1.3 christos additional information. 661 1.1.1.3 christos 662 1.1 christos =head1 EXAMPLES 663 1.1 christos 664 1.1 christos Set supported signature algorithms: 665 1.1 christos 666 1.1 christos SSL_CONF_cmd(ctx, "SignatureAlgorithms", "ECDSA+SHA256:RSA+SHA256:DSA+SHA256"); 667 1.1 christos 668 1.1 christos There are various ways to select the supported protocols. 669 1.1 christos 670 1.1 christos This set the minimum protocol version to TLSv1, and so disables SSLv3. 671 1.1 christos This is the recommended way to disable protocols. 672 1.1 christos 673 1.1 christos SSL_CONF_cmd(ctx, "MinProtocol", "TLSv1"); 674 1.1 christos 675 1.1 christos The following also disables SSLv3: 676 1.1 christos 677 1.1 christos SSL_CONF_cmd(ctx, "Protocol", "-SSLv3"); 678 1.1 christos 679 1.1 christos The following will first enable all protocols, and then disable 680 1.1 christos SSLv3. 681 1.1 christos If no protocol versions were disabled before this has the same effect as 682 1.1 christos "-SSLv3", but if some versions were disables this will re-enable them before 683 1.1 christos disabling SSLv3. 684 1.1 christos 685 1.1 christos SSL_CONF_cmd(ctx, "Protocol", "ALL,-SSLv3"); 686 1.1 christos 687 1.1 christos Only enable TLSv1.2: 688 1.1 christos 689 1.1 christos SSL_CONF_cmd(ctx, "MinProtocol", "TLSv1.2"); 690 1.1 christos SSL_CONF_cmd(ctx, "MaxProtocol", "TLSv1.2"); 691 1.1 christos 692 1.1 christos This also only enables TLSv1.2: 693 1.1 christos 694 1.1 christos SSL_CONF_cmd(ctx, "Protocol", "-ALL,TLSv1.2"); 695 1.1 christos 696 1.1 christos Disable TLS session tickets: 697 1.1 christos 698 1.1 christos SSL_CONF_cmd(ctx, "Options", "-SessionTicket"); 699 1.1 christos 700 1.1 christos Enable compression: 701 1.1 christos 702 1.1 christos SSL_CONF_cmd(ctx, "Options", "Compression"); 703 1.1 christos 704 1.1 christos Set supported curves to P-256, P-384: 705 1.1 christos 706 1.1 christos SSL_CONF_cmd(ctx, "Curves", "P-256:P-384"); 707 1.1 christos 708 1.1 christos =head1 SEE ALSO 709 1.1 christos 710 1.1.1.6 christos L<ssl(7)>, 711 1.1 christos L<SSL_CONF_CTX_new(3)>, 712 1.1 christos L<SSL_CONF_CTX_set_flags(3)>, 713 1.1 christos L<SSL_CONF_CTX_set1_prefix(3)>, 714 1.1 christos L<SSL_CONF_CTX_set_ssl_ctx(3)>, 715 1.1 christos L<SSL_CONF_cmd_argv(3)>, 716 1.1 christos L<SSL_CTX_set_options(3)> 717 1.1 christos 718 1.1 christos =head1 HISTORY 719 1.1 christos 720 1.1.1.2 christos The SSL_CONF_cmd() function was added in OpenSSL 1.0.2. 721 1.1 christos 722 1.1.1.2 christos The B<SSL_OP_NO_SSL2> option doesn't have effect since 1.1.0, but the macro 723 1.1.1.2 christos is retained for backwards compatibility. 724 1.1 christos 725 1.1.1.2 christos The B<SSL_CONF_TYPE_NONE> was added in OpenSSL 1.1.0. In earlier versions of 726 1.1 christos OpenSSL passing a command which didn't take an argument would return 727 1.1 christos B<SSL_CONF_TYPE_UNKNOWN>. 728 1.1 christos 729 1.1 christos B<MinProtocol> and B<MaxProtocol> where added in OpenSSL 1.1.0. 730 1.1 christos 731 1.1 christos B<AllowNoDHEKEX> and B<PrioritizeChaCha> were added in OpenSSL 1.1.1. 732 1.1 christos 733 1.1.1.6 christos The B<UnsafeLegacyServerConnect> option is no longer set by default from 734 1.1.1.6 christos OpenSSL 3.0. 735 1.1.1.6 christos 736 1.1 christos =head1 COPYRIGHT 737 1.1 christos 738 1.1.1.5 christos Copyright 2012-2022 The OpenSSL Project Authors. All Rights Reserved. 739 1.1 christos 740 1.1.1.6 christos Licensed under the Apache License 2.0 (the "License"). You may not use 741 1.1 christos this file except in compliance with the License. You can obtain a copy 742 1.1 christos in the file LICENSE in the source distribution or at 743 1.1 christos L<https://www.openssl.org/source/license.html>. 744 1.1 christos 745 1.1 christos =cut 746