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