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