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