Home | History | Annotate | Line # | Download | only in man1
openssl-verification-options.pod revision 1.1.1.3
      1 =pod
      2 
      3 =head1 NAME
      4 
      5 openssl-verification-options - generic X.509 certificate verification options
      6 
      7 =head1 SYNOPSIS
      8 
      9 B<openssl>
     10 I<command>
     11 [ I<options> ... ]
     12 [ I<parameters> ... ]
     13 
     14 =head1 DESCRIPTION
     15 
     16 There are many situations where X.509 certificates are verified
     17 within the OpenSSL libraries and in various OpenSSL commands.
     18 
     19 Certificate verification is implemented by L<X509_verify_cert(3)>.
     20 It is a complicated process consisting of a number of steps
     21 and depending on numerous options.
     22 The most important of them are detailed in the following sections.
     23 
     24 In a nutshell, a valid chain of certificates needs to be built up and verified
     25 starting from the I<target certificate> that is to be verified
     26 and ending in a certificate that due to some policy is trusted.
     27 Certificate validation can be performed in the context of a I<purpose>, which
     28 is a high-level specification of the intended use of the target certificate,
     29 such as C<sslserver> for TLS servers, or (by default) for any purpose.
     30 
     31 The details of how each OpenSSL command handles errors
     32 are documented on the specific command page.
     33 
     34 DANE support is documented in L<openssl-s_client(1)>,
     35 L<SSL_CTX_dane_enable(3)>, L<SSL_set1_host(3)>,
     36 L<X509_VERIFY_PARAM_set_flags(3)>, and L<X509_check_host(3)>.
     37 
     38 =head2 Trust Anchors
     39 
     40 In general, according to RFC 4158 and RFC 5280, a I<trust anchor> is
     41 any public key and related subject distinguished name (DN) that
     42 for some reason is considered trusted
     43 and thus is acceptable as the root of a chain of certificates.
     44 
     45 In practice, trust anchors are given in the form of certificates,
     46 where their essential fields are the public key and the subject DN.
     47 In addition to the requirements in RFC 5280,
     48 OpenSSL checks the validity period of such certificates
     49 and makes use of some further fields.
     50 In particular, the subject key identifier extension, if present,
     51 is used for matching trust anchors during chain building.
     52 
     53 In the most simple and common case, trust anchors are by default
     54 all self-signed "root" CA certificates that are placed in the I<trust store>,
     55 which is a collection of certificates that are trusted for certain uses.
     56 This is akin to what is used in the trust stores of Mozilla Firefox,
     57 or Apple's and Microsoft's certificate stores, ...
     58 
     59 From the OpenSSL perspective, a trust anchor is a certificate
     60 that should be augmented with an explicit designation for which
     61 uses of a target certificate the certificate may serve as a trust anchor.
     62 In PEM encoding, this is indicated by the C<TRUSTED CERTIFICATE> string.
     63 Such a designation provides a set of positive trust attributes
     64 explicitly stating trust for the listed purposes
     65 and/or a set of negative trust attributes
     66 explicitly rejecting the use for the listed purposes.
     67 The purposes are encoded using the values defined for the extended key usages
     68 (EKUs) that may be given in X.509 extensions of end-entity certificates.
     69 See also the L</Extended Key Usage> section below.
     70 
     71 The currently recognized uses are
     72 B<clientAuth> (SSL client use), B<serverAuth> (SSL server use),
     73 B<emailProtection> (S/MIME email use), B<codeSigning> (object signer use),
     74 B<OCSPSigning> (OCSP responder use), B<OCSP> (OCSP request use),
     75 B<timeStamping> (TSA server use), and B<anyExtendedKeyUsage>.
     76 As of OpenSSL 1.1.0, the last of these blocks all uses when rejected or
     77 enables all uses when trusted.
     78 
     79 A certificate, which may be CA certificate or an end-entity certificate,
     80 is considered a trust anchor for the given use
     81 if and only if all the following conditions hold:
     82 
     83 =over 4
     84 
     85 =item *
     86 
     87 It is an an element of the trust store.
     88 
     89 =item *
     90 
     91 It does not have a negative trust attribute rejecting the given use.
     92 
     93 =item *
     94 
     95 It has a positive trust attribute accepting the given use
     96 or (by default) one of the following compatibility conditions apply:
     97 It is self-signed or the B<-partial_chain> option is given
     98 (which corresponds to the B<X509_V_FLAG_PARTIAL_CHAIN> flag being set).
     99 
    100 =back
    101 
    102 =head2 Certification Path Building
    103 
    104 First, a certificate chain is built up starting from the target certificate
    105 and ending in a trust anchor.
    106 
    107 The chain is built up iteratively, looking up in turn
    108 a certificate with suitable key usage that
    109 matches as an issuer of the current "subject" certificate as described below.
    110 If there is such a certificate, the first one found that is currently valid
    111 is taken, otherwise the one that expired most recently of all such certificates.
    112 For efficiency, no backtracking is performed, thus
    113 any further candidate issuer certificates that would match equally are ignored.
    114 
    115 When a self-signed certificate has been added, chain construction stops.
    116 In this case it must fully match a trust anchor, otherwise chain building fails.
    117 
    118 A candidate issuer certificate matches a subject certificate
    119 if all of the following conditions hold:
    120 
    121 =over 4
    122 
    123 =item *
    124 
    125 Its subject name matches the issuer name of the subject certificate.
    126 
    127 =item *
    128 
    129 If the subject certificate has an authority key identifier extension,
    130 each of its sub-fields equals the corresponding subject key identifier, serial
    131 number, and issuer field of the candidate issuer certificate,
    132 as far as the respective fields are present in both certificates.
    133 
    134 =item *
    135 
    136 The certificate signature algorithm used to sign the subject certificate
    137 is supported and
    138 equals the public key algorithm of the candidate issuer certificate.
    139 
    140 =back
    141 
    142 The lookup first searches for issuer certificates in the trust store.
    143 If it does not find a match there it consults
    144 the list of untrusted ("intermediate" CA) certificates, if provided.
    145 If one issuer certificate was found in the trust store, the list of
    146 untrusted certificates will not be consulted anymore to find further
    147 issuer certificates. Therefore, either only the root certificate or an
    148 uninterrupted chain to the root certificate must be provided in the trust
    149 store for a successful verification, if B<X509_V_FLAG_PARTIAL_CHAIN>
    150 is not enabled.
    151 
    152 =head2 Certification Path Validation
    153 
    154 When the certificate chain building process was successful
    155 the chain components and their links are checked thoroughly.
    156 
    157 The first step is to check that each certificate is well-formed.
    158 Part of these checks are enabled only if the B<-x509_strict> option is given.
    159 
    160 The second step is to check the X.509v3 extensions of every certificate
    161 for consistency with the intended specific purpose, if any.
    162 If the B<-purpose> option is not given then no such checks are done except for
    163 CMS signature checking, where by default C<smimesign> is checked, and SSL/(D)TLS
    164 connection setup, where by default C<sslserver> or C<sslclient> are checked.
    165 The X.509v3 extensions of the target or "leaf" certificate
    166 must be compatible with the specified purpose.
    167 All other certificates down the chain are checked to be valid CA certificates,
    168 and possibly also further non-standard checks are performed.
    169 The precise extensions required are described in detail
    170 in the L</Certificate Extensions> section below.
    171 
    172 The third step is to check the trust settings on the last certificate
    173 (which typically is a self-signed root CA certificate).
    174 It must be trusted for the given use.
    175 For compatibility with previous versions of OpenSSL, a self-signed certificate
    176 with no trust attributes is considered to be valid for all uses.
    177 
    178 The fourth, and final, step is to check the validity of the certificate chain.
    179 For each element in the chain, including the root CA certificate,
    180 the validity period as specified by the C<notBefore> and C<notAfter> fields
    181 is checked against the current system time.
    182 The B<-attime> flag may be used to use a reference time other than "now."
    183 The certificate signature is checked as well
    184 (except for the signature of the typically self-signed root CA certificate,
    185 which is verified only if the B<-check_ss_sig> option is given).
    186 When verifying a certificate signature
    187 the keyUsage extension (if present) of the candidate issuer certificate
    188 is checked to permit digitalSignature for signing proxy certificates
    189 or to permit keyCertSign for signing other certificates, respectively.
    190 If all operations complete successfully then certificate is considered
    191 valid. If any operation fails then the certificate is not valid.
    192 
    193 =head1 OPTIONS
    194 
    195 =head2 Trusted Certificate Options
    196 
    197 The following options specify how to supply the certificates
    198 that can be used as trust anchors for certain uses.
    199 As mentioned, a collection of such certificates is called a I<trust store>.
    200 
    201 Note that OpenSSL does not provide a default set of trust anchors.  Many
    202 Linux distributions include a system default and configure OpenSSL to point
    203 to that.  Mozilla maintains an influential trust store that can be found at
    204 L<https://www.mozilla.org/en-US/about/governance/policies/security-group/certs/>.
    205 
    206 The certificates to add to the trust store
    207 can be specified using following options.
    208 
    209 =over 4
    210 
    211 =item B<-CAfile> I<file>
    212 
    213 Load the specified file which contains a trusted certificate in DER format
    214 or potentially several of them in case the input is in PEM format.
    215 PEM-encoded certificates may also have trust attributes set.
    216 
    217 =item B<-no-CAfile>
    218 
    219 Do not load the default file of trusted certificates.
    220 
    221 =item B<-CApath> I<dir>
    222 
    223 Use the specified directory as a collection of trusted certificates,
    224 i.e., a trust store.
    225 Files should be named with the hash value of the X.509 SubjectName of each
    226 certificate. This is so that the library can extract the IssuerName,
    227 hash it, and directly lookup the file to get the issuer certificate.
    228 See L<openssl-rehash(1)> for information on creating this type of directory.
    229 
    230 =item B<-no-CApath>
    231 
    232 Do not use the default directory of trusted certificates.
    233 
    234 =item B<-CAstore> I<uri>
    235 
    236 Use I<uri> as a store of CA certificates.
    237 The URI may indicate a single certificate, as well as a collection of them.
    238 With URIs in the C<file:> scheme, this acts as B<-CAfile> or
    239 B<-CApath>, depending on if the URI indicates a single file or
    240 directory.
    241 See L<ossl_store-file(7)> for more information on the C<file:> scheme.
    242 
    243 These certificates are also used when building the server certificate
    244 chain (for example with L<openssl-s_server(1)>) or client certificate
    245 chain (for example with L<openssl-s_time(1)>).
    246 
    247 =item B<-no-CAstore>
    248 
    249 Do not use the default store of trusted CA certificates.
    250 
    251 =back
    252 
    253 =head2 Verification Options
    254 
    255 The certificate verification can be fine-tuned with the following flags.
    256 
    257 =over 4
    258 
    259 =item B<-verbose>
    260 
    261 Print extra information about the operations being performed.
    262 
    263 =item B<-attime> I<timestamp>
    264 
    265 Perform validation checks using time specified by I<timestamp> and not
    266 current system time. I<timestamp> is the number of seconds since
    267 January 1, 1970 (i.e., the Unix Epoch).
    268 
    269 =item B<-no_check_time>
    270 
    271 This option suppresses checking the validity period of certificates and CRLs
    272 against the current time. If option B<-attime> is used to specify
    273 a verification time, the check is not suppressed.
    274 
    275 =item B<-x509_strict>
    276 
    277 This disables non-compliant workarounds for broken certificates.
    278 Thus errors are thrown on certificates not compliant with RFC 5280.
    279 
    280 When this option is set,
    281 among others, the following certificate well-formedness conditions are checked:
    282 
    283 =over 4
    284 
    285 =item *
    286 
    287 The basicConstraints of CA certificates must be marked critical.
    288 
    289 =item *
    290 
    291 CA certificates must explicitly include the keyUsage extension.
    292 
    293 =item *
    294 
    295 If a pathlenConstraint is given the key usage keyCertSign must be allowed.
    296 
    297 =item *
    298 
    299 The pathlenConstraint must not be given for non-CA certificates.
    300 
    301 =item *
    302 
    303 The issuer name of any certificate must not be empty.
    304 
    305 =item *
    306 
    307 The subject name of CA certs, certs with keyUsage crlSign, and certs
    308 without subjectAlternativeName must not be empty.
    309 
    310 =item *
    311 
    312 If a subjectAlternativeName extension is given it must not be empty.
    313 
    314 =item *
    315 
    316 The signatureAlgorithm field and the cert signature must be consistent.
    317 
    318 =item *
    319 
    320 Any given authorityKeyIdentifier and any given subjectKeyIdentifier
    321 must not be marked critical.
    322 
    323 =item *
    324 
    325 The authorityKeyIdentifier must be given for X.509v3 certs unless they
    326 are self-signed.
    327 
    328 =item *
    329 
    330 The subjectKeyIdentifier must be given for all X.509v3 CA certs.
    331 
    332 =back
    333 
    334 =item B<-ignore_critical>
    335 
    336 Normally if an unhandled critical extension is present that is not
    337 supported by OpenSSL the certificate is rejected (as required by RFC5280).
    338 If this option is set critical extensions are ignored.
    339 
    340 =item B<-issuer_checks>
    341 
    342 Ignored.
    343 
    344 =item B<-crl_check>
    345 
    346 Checks end entity certificate validity by attempting to look up a valid CRL.
    347 If a valid CRL cannot be found an error occurs.
    348 
    349 =item B<-crl_check_all>
    350 
    351 Checks the validity of B<all> certificates in the chain by attempting
    352 to look up valid CRLs.
    353 
    354 =item B<-use_deltas>
    355 
    356 Enable support for delta CRLs.
    357 
    358 =item B<-extended_crl>
    359 
    360 Enable extended CRL features such as indirect CRLs and alternate CRL
    361 signing keys.
    362 
    363 =item B<-suiteB_128_only>, B<-suiteB_128>, B<-suiteB_192>
    364 
    365 Enable the Suite B mode operation at 128 bit Level of Security, 128 bit or
    366 192 bit, or only 192 bit Level of Security respectively.
    367 See RFC6460 for details. In particular the supported signature algorithms are
    368 reduced to support only ECDSA and SHA256 or SHA384 and only the elliptic curves
    369 P-256 and P-384.
    370 
    371 =item B<-auth_level> I<level>
    372 
    373 Set the certificate chain authentication security level to I<level>.
    374 The authentication security level determines the acceptable signature and
    375 public key strength when verifying certificate chains.  For a certificate
    376 chain to validate, the public keys of all the certificates must meet the
    377 specified security I<level>.  The signature algorithm security level is
    378 enforced for all the certificates in the chain except for the chain's
    379 I<trust anchor>, which is either directly trusted or validated by means
    380 other than its signature.  See L<SSL_CTX_set_security_level(3)> for the
    381 definitions of the available levels.  The default security level is -1,
    382 or "not set".  At security level 0 or lower all algorithms are acceptable.
    383 Security level 1 requires at least 80-bit-equivalent security and is broadly
    384 interoperable, though it will, for example, reject MD5 signatures or RSA
    385 keys shorter than 1024 bits.
    386 
    387 =item B<-partial_chain>
    388 
    389 Allow verification to succeed if an incomplete chain can be built.
    390 That is, a chain ending in a certificate that normally would not be trusted
    391 (because it has no matching positive trust attributes and is not self-signed)
    392 but is an element of the trust store.
    393 This certificate may be self-issued or belong to an intermediate CA.
    394 
    395 =item B<-check_ss_sig>
    396 
    397 Verify the signature of
    398 the last certificate in a chain if the certificate is supposedly self-signed.
    399 This is prohibited and will result in an error if it is a non-conforming CA
    400 certificate with key usage restrictions not including the keyCertSign bit.
    401 This verification is disabled by default because it doesn't add any security.
    402 
    403 =item B<-allow_proxy_certs>
    404 
    405 Allow the verification of proxy certificates.
    406 
    407 =item B<-trusted_first>
    408 
    409 As of OpenSSL 1.1.0 this option is on by default and cannot be disabled.
    410 
    411 When constructing the certificate chain, the trusted certificates specified
    412 via B<-CAfile>, B<-CApath>, B<-CAstore> or B<-trusted> are always used
    413 before any certificates specified via B<-untrusted>.
    414 
    415 =item B<-no_alt_chains>
    416 
    417 As of OpenSSL 1.1.0, since B<-trusted_first> always on, this option has no
    418 effect.
    419 
    420 =item B<-trusted> I<file>
    421 
    422 Parse I<file> as a set of one or more certificates.
    423 Each of them qualifies as trusted if has a suitable positive trust attribute
    424 or it is self-signed or the B<-partial_chain> option is specified.
    425 This option implies the B<-no-CAfile>, B<-no-CApath>, and B<-no-CAstore> options
    426 and it cannot be used with the B<-CAfile>, B<-CApath> or B<-CAstore> options, so
    427 only certificates specified using the B<-trusted> option are trust anchors.
    428 This option may be used multiple times.
    429 
    430 =item B<-untrusted> I<file>
    431 
    432 Parse I<file> as a set of one or more certificates.
    433 All certificates (typically of intermediate CAs) are considered untrusted
    434 and may be used to
    435 construct a certificate chain from the target certificate to a trust anchor.
    436 This option may be used multiple times.
    437 
    438 =item B<-policy> I<arg>
    439 
    440 Enable policy processing and add I<arg> to the user-initial-policy-set (see
    441 RFC5280). The policy I<arg> can be an object name or an OID in numeric form.
    442 This argument can appear more than once.
    443 
    444 =item B<-explicit_policy>
    445 
    446 Set policy variable require-explicit-policy (see RFC5280).
    447 
    448 =item B<-policy_check>
    449 
    450 Enables certificate policy processing.
    451 
    452 =item B<-policy_print>
    453 
    454 Print out diagnostics related to policy processing.
    455 
    456 =item B<-inhibit_any>
    457 
    458 Set policy variable inhibit-any-policy (see RFC5280).
    459 
    460 =item B<-inhibit_map>
    461 
    462 Set policy variable inhibit-policy-mapping (see RFC5280).
    463 
    464 =item B<-purpose> I<purpose>
    465 
    466 A high-level specification of the intended use of the target certificate.
    467 Currently predefined purposes are C<sslclient>, C<sslserver>, C<nssslserver>,
    468 C<smimesign>, C<smimeencrypt>, C<crlsign>, C<ocsphelper>, C<timestampsign>,
    469 C<codesign> and C<any>.
    470 If peer certificate verification is enabled, by default the TLS implementation
    471 and thus the commands L<openssl-s_client(1)> and L<openssl-s_server(1)>
    472 check for consistency with
    473 TLS server (C<sslserver>) or TLS client use (C<sslclient>), respectively.
    474 By default, CMS signature validation, which can be done via L<openssl-cms(1)>,
    475 checks for consistency with S/MIME signing use (C<smimesign>).
    476 
    477 While IETF RFC 5280 says that B<id-kp-serverAuth> and B<id-kp-clientAuth>
    478 are only for WWW use, in practice they are used for all kinds of TLS clients
    479 and servers, and this is what OpenSSL assumes as well.
    480 
    481 =item B<-verify_depth> I<num>
    482 
    483 Limit the certificate chain to I<num> intermediate CA certificates.
    484 A maximal depth chain can have up to I<num>+2 certificates, since neither the
    485 end-entity certificate nor the trust-anchor certificate count against the
    486 B<-verify_depth> limit.
    487 
    488 =item B<-verify_email> I<email>
    489 
    490 Verify if I<email> matches the email address in Subject Alternative Name or
    491 the email in the subject Distinguished Name.
    492 
    493 =item B<-verify_hostname> I<hostname>
    494 
    495 Verify if I<hostname> matches DNS name in Subject Alternative Name or
    496 Common Name in the subject certificate.
    497 
    498 =item B<-verify_ip> I<ip>
    499 
    500 Verify if I<ip> matches the IP address in Subject Alternative Name of
    501 the subject certificate.
    502 
    503 =item B<-verify_name> I<name>
    504 
    505 Use a set of verification parameters, also known as verification method,
    506 identified by I<name>. The currently predefined methods are named C<ssl_client>,
    507 C<ssl_server>, C<smime_sign> with alias C<pkcs7>, C<code_sign>, and C<default>.
    508 These mimic the combinations of purpose and trust settings used in SSL/(D)TLS,
    509 CMS/PKCS7 (including S/MIME), and code signing.
    510 
    511 The verification parameters include the trust model, various flags that can
    512 partly be set also via other command-line options, and the verification purpose,
    513 which in turn implies certificate key usage and extended key usage requirements.
    514 
    515 The trust model determines which auxiliary trust or reject OIDs are applicable
    516 to verifying the given certificate chain.
    517 They can be given using the B<-addtrust> and B<-addreject> options
    518 for L<openssl-x509(1)>.
    519 
    520 =back
    521 
    522 =head2 Extended Verification Options
    523 
    524 Sometimes there may be more than one certificate chain leading to an
    525 end-entity certificate.
    526 This usually happens when a root or intermediate CA signs a certificate
    527 for another a CA in other organization.
    528 Another reason is when a CA might have intermediates that use two different
    529 signature formats, such as a SHA-1 and a SHA-256 digest.
    530 
    531 The following options can be used to provide data that will allow the
    532 OpenSSL command to generate an alternative chain.
    533 
    534 =over 4
    535 
    536 =item B<-xkey> I<infile>, B<-xcert> I<infile>, B<-xchain>
    537 
    538 Specify an extra certificate, private key and certificate chain. These behave
    539 in the same manner as the B<-cert>, B<-key> and B<-cert_chain> options.  When
    540 specified, the callback returning the first valid chain will be in use by the
    541 client.
    542 
    543 =item B<-xchain_build>
    544 
    545 Specify whether the application should build the certificate chain to be
    546 provided to the server for the extra certificates via the B<-xkey>,
    547 B<-xcert>, and B<-xchain> options.
    548 
    549 =item B<-xcertform> B<DER>|B<PEM>|B<P12>
    550 
    551 The input format for the extra certificate.
    552 This option has no effect and is retained for backward compatibility only.
    553 
    554 =item B<-xkeyform> B<DER>|B<PEM>|B<P12>
    555 
    556 The input format for the extra key.
    557 This option has no effect and is retained for backward compatibility only.
    558 
    559 =back
    560 
    561 =head2 Certificate Extensions
    562 
    563 Options like B<-purpose> and B<-verify_name> trigger the processing of specific
    564 certificate extensions, which determine what certificates can be used for.
    565 
    566 =head3 Basic Constraints
    567 
    568 The basicConstraints extension CA flag is used to determine whether the
    569 certificate can be used as a CA. If the CA flag is true then it is a CA,
    570 if the CA flag is false then it is not a CA. B<All> CAs should have the
    571 CA flag set to true.
    572 
    573 If the basicConstraints extension is absent,
    574 which includes the case that it is an X.509v1 certificate,
    575 then the certificate is considered to be a "possible CA" and
    576 other extensions are checked according to the intended use of the certificate.
    577 The treatment of certificates without basicConstraints as a CA
    578 is presently supported, but this could change in the future.
    579 
    580 =head3 Key Usage
    581 
    582 If the keyUsage extension is present then additional restraints are
    583 made on the uses of the certificate. A CA certificate B<must> have the
    584 keyCertSign bit set if the keyUsage extension is present.
    585 
    586 =head3 Extended Key Usage
    587 
    588 The extKeyUsage (EKU) extension places additional restrictions on
    589 certificate use. If this extension is present (whether critical or not)
    590 in an end-entity certificate, the key is allowed only for the uses specified,
    591 while the special EKU B<anyExtendedKeyUsage> allows for all uses.
    592 
    593 Note that according to RFC 5280 section 4.2.1.12,
    594 the Extended Key Usage extension will appear only in end-entity certificates,
    595 and consequently the standard certification path validation described
    596 in its section 6 does not include EKU checks for CA certificates.
    597 The CA/Browser Forum requires for TLS server, S/MIME, and code signing use
    598 the presence of respective EKUs in subordinate CA certificates (while excluding
    599 them for root CA certificates), while taking over from RFC 5280
    600 the certificate validity concept and certificate path validation.
    601 
    602 For historic reasons, OpenSSL has its own way of interpreting and checking
    603 EKU extensions on CA certificates, which may change in the future.
    604 It does not require the presence of EKU extensions in CA certificates,
    605 but in case the verification purpose is
    606 C<sslclient>, C<nssslserver>, C<sslserver>, C<smimesign>, or C<smimeencrypt>,
    607 it checks that any present EKU extension (that does not contain
    608 B<anyExtendedKeyUsage>) contains the respective EKU as detailed below.
    609 Moreover, it does these checks even for trust anchor certificates.
    610 
    611 =head3 Checks Implied by Specific Predefined Policies
    612 
    613 A specific description of each check is given below. The comments about
    614 basicConstraints and keyUsage and X.509v1 certificates above apply to B<all>
    615 CA certificates.
    616 
    617 =over 4
    618 
    619 =item B<(D)TLS Client> (C<sslclient>)
    620 
    621 Any given extended key usage extension must allow for C<clientAuth>
    622 ("TLS WWW client authentication").
    623 
    624 For target certificates,
    625 the key usage must allow for C<digitalSignature> and/or C<keyAgreement>.
    626 The Netscape certificate type must be absent or have the SSL client bit set.
    627 
    628 For all other certificates the normal CA checks apply. In addition,
    629 the Netscape certificate type must be absent or have the SSL CA bit set.
    630 This is used as a workaround if the basicConstraints extension is absent.
    631 
    632 =item B<(D)TLS Server> (C<sslserver>)
    633 
    634 Any given extended key usage extension must allow for C<serverAuth>
    635 ("TLS WWW server authentication") and/or include one of the SGC OIDs.
    636 
    637 For target certificates, the key usage must
    638 allow for C<digitalSignature>, C<keyEncipherment>, and/or C<keyAgreement>.
    639 The Netscape certificate type must be absent or have the SSL server bit set.
    640 
    641 For all other certificates the normal CA checks apply. In addition,
    642 the Netscape certificate type must be absent or have the SSL CA bit set.
    643 This is used as a workaround if the basicConstraints extension is absent.
    644 
    645 =item B<Netscape SSL Server> (C<nssslserver>)
    646 
    647 In addition to what has been described for B<sslserver>, for a Netscape
    648 SSL client to connect to an SSL server, its EE certificate must have the
    649 B<keyEncipherment> bit set if the keyUsage extension is present. This isn't
    650 always valid because some cipher suites use the key for digital signing.
    651 Otherwise it is the same as a normal SSL server.
    652 
    653 =item B<Common S/MIME Checks>
    654 
    655 Any given extended key usage extension must allow for C<emailProtection>.
    656 
    657 For target certificates,
    658 the Netscape certificate type must be absent or should have the S/MIME bit set.
    659 If the S/MIME bit is not set in the Netscape certificate type
    660 then the SSL client bit is tolerated as an alternative but a warning is shown.
    661 This is because some Verisign certificates don't set the S/MIME bit.
    662 
    663 For all other certificates the normal CA checks apply. In addition,
    664 the Netscape certificate type must be absent or have the S/MIME CA bit set.
    665 This is used as a workaround if the basicConstraints extension is absent.
    666 
    667 =item B<S/MIME Signing> (C<smimesign>)
    668 
    669 In addition to the common S/MIME checks, for target certificates
    670 the key usage must allow for C<digitalSignature> and/or B<nonRepudiation>.
    671 
    672 =item B<S/MIME Encryption> (C<smimeencrypt>)
    673 
    674 In addition to the common S/MIME checks, for target certificates
    675 the key usage must allow for C<keyEncipherment>.
    676 
    677 =item B<CRL Signing> (C<crlsign>)
    678 
    679 For target certificates, the key usage must allow for C<cRLSign>.
    680 
    681 For all other certificates the normal CA checks apply.
    682 Except in this case the basicConstraints extension must be present.
    683 
    684 =item B<OCSP Helper> (C<ocsphelper>)
    685 
    686 For target certificates, no checks are performed at this stage,
    687 but special checks apply; see L<OCSP_basic_verify(3)>.
    688 
    689 For all other certificates the normal CA checks apply.
    690 
    691 =item B<Timestamp Signing> (C<timestampsign>)
    692 
    693 For target certificates, if the key usage extension is present, it must include
    694 C<digitalSignature> and/or C<nonRepudiation> and must not include other bits.
    695 The EKU extension must be present and contain C<timeStamping> only.
    696 Moreover, it must be marked as critical.
    697 
    698 For all other certificates the normal CA checks apply.
    699 
    700 =item B<Code Signing> (C<codesign>)
    701 
    702 For target certificates,
    703 the key usage extension must be present and marked critical and
    704 include <digitalSignature>, but must not include C<keyCertSign> nor C<cRLSign>.
    705 The EKU extension must be present and contain C<codeSign>,
    706 but must not include C<anyExtendedKeyUsage> nor C<serverAuth>.
    707 
    708 For all other certificates the normal CA checks apply.
    709 
    710 =back
    711 
    712 =head1 BUGS
    713 
    714 The issuer checks still suffer from limitations in the underlying X509_LOOKUP
    715 API.  One consequence of this is that trusted certificates with matching
    716 subject name must appear in a file (as specified by the B<-CAfile> option),
    717 a directory (as specified by B<-CApath>),
    718 or a store (as specified by B<-CAstore>).
    719 If there are multiple such matches, possibly in multiple locations,
    720 only the first one (in the mentioned order of locations) is recognised.
    721 
    722 =head1 SEE ALSO
    723 
    724 L<X509_verify_cert(3)>,
    725 L<OCSP_basic_verify(3)>,
    726 L<openssl-verify(1)>,
    727 L<openssl-ocsp(1)>,
    728 L<openssl-ts(1)>,
    729 L<openssl-s_client(1)>,
    730 L<openssl-s_server(1)>,
    731 L<openssl-smime(1)>,
    732 L<openssl-cmp(1)>,
    733 L<openssl-cms(1)>
    734 
    735 =head1 HISTORY
    736 
    737 The checks enabled by B<-x509_strict> have been extended in OpenSSL 3.0.
    738 
    739 =head1 COPYRIGHT
    740 
    741 Copyright 2000-2026 The OpenSSL Project Authors. All Rights Reserved.
    742 
    743 Licensed under the Apache License 2.0 (the "License").  You may not use
    744 this file except in compliance with the License.  You can obtain a copy
    745 in the file LICENSE in the source distribution or at
    746 L<https://www.openssl.org/source/license.html>.
    747 
    748 =cut
    749