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