OPENSSL-VERIFICATION-OPTIONS(1SSL)

πŸ’– OPENSSL-VERIFICATION-OPTIONS(1SSL) πŸ’–

okay bestie, you're reading the OpenSSL manual page for openssl-verification-options β€” the generic X.509 certificate verification options. It's giving "I know my trust store" energy, fr fr. πŸ’…


✨ NAME ✨

openssl-verification-options β€” generic X.509 certificate verification options. no cap.

πŸ¦‹ SYNOPSIS πŸ¦‹

openssl command [ options ... ] [ parameters ... ]

πŸ’– DESCRIPTION πŸ’–

Okay so X.509 public-key certificates get verified in a bunch of situations inside the OpenSSL libraries and across various OpenSSL commands. For checking certificates, the term validation would actually be more appropriate, but for historical reasons the term verification is often used instead. periodt.

In the sequel, the certificate to be validated is called the target certificate. Since it usually is an end-entity (EE) certificate, it is also known as the "leaf" certificate (of a chain or tree), but it may also be a CA certificate. Certificate verification is implemented by X509_verify_cert(3). The validation process involves several steps and depends on multiple options. The most important of them are detailed in the following sections.

In a nutshell, a valid chain of certificates needs to be constructed and checked starting from the target certificate that is to be validated and ending in a trust anchor, which usually is a certificate that due to some policy is trusted. Certificate validation can be performed in the context of a purpose, which is a high-level specification of the intended use of the target certificate, such as "sslserver" for (D)TLS servers, or (by default) for any purpose.

All certificates in the chain except the target certificate must be CA certificates. An X.509v3 certificate is considered a CA certificate if it has a basicConstraints extension with the CA flag set. If a pathLenConstraint is included then the chain is checked to satisfy it. If a CA certificate has a keyUsage extension then the latter must include the keyCertSign bit, and for proxy certificates used for issuing a certificate it must include also the digitalSignature bit.

The details of how each OpenSSL command handles errors are documented on the specific command page.

DANE support is documented in openssl-s_client(1), SSL_CTX_dane_enable(3), SSL_set1_host(3), X509_VERIFY_PARAM_set_flags(3), and X509_check_host(3).

πŸŽ€ Trust Anchors πŸŽ€

In general, according to RFC 4158 and RFC 5280, a trust anchor is just a public key (with algorithm and any parameters) and an associated subject name that in a suitable context is considered trusted for some purpose(s) and thus is acceptable as the root of a chain of certificates.

In practice, trust anchors are given in the form of certificates. Commonly they are self-signed root CA certificates. Their most essential fields are the subjectPublicKeyInfo and the subject distinguished name (DN), while the subject key identifier extension is generally optional but highly recommended to be included in CA certificates because they help chain building. In addition to the requirements given in RFC 5280 for trust anchor handling, OpenSSL performs on trust anchor certificates the same checks as on regular CA certificates, in particular those regarding the validity period and X.509v3 extensions like basic constraints and key usage. Depending on the given validation purpose, in part even the extended key usage is checked β€” for details see the "Extended Key Usage" section below.

The most crucial input to certificate validation is a trust store, which includes a collection of certificates and validation options. This is akin to what is used in the trust stores of Mozilla Firefox, or Apple's and Microsoft's certificate stores, ... By default all apparently self-signed certificates in the trust store are considered to be trust anchors, for all or for specified purposes.

For efficiency reasons, apparently self-signed certificates (based on certificate metadata) are not subjected to cryptographic self-signature check. A certificate is apparently self-signed if and only if all of the following conditions are met:

  • it is self-issued, i.e., its "subject" and "issuer" fields are equal,
  • the algorithm identifiers of its public key and signature match,
  • if it has an authorityKeyIdentifier (AKID) extension containing the "keyIdentifier" field, its value matches the subjectKeyIdentifier (SKID) extension if present,
  • if it has an AKID containing the "authorityCertSerialNumber" field, its value equals the serial number of the certificate, and
  • if it has an AKID containing the "authorityCertIssuer" field and its "GeneralNames" include at least one "directoryName", the first such name equals the "issuer" field of the certificate.

Independent of any extended key usage (EKU) X.509v3 extension included, from the OpenSSL perspective a trust anchor certificate should be augmented with local trust attributes, giving an explicit designation for which uses of a target certificate the certificate may serve as a trust anchor. If this information is missing, it is by default trusted for all uses. In PEM encoding, the presence of trust attributes is indicated by the "TRUSTED CERTIFICATE" string. Such a designation provides a set of positive trust attributes explicitly stating acceptance for the listed uses and/or a set of negative trust attributes explicitly rejecting the listed uses. These uses are encoded using the OID values defined for the extended key usages that may be included in X.509v3 certificate extensions. For the list of EKUs with currently predefined meaning see the "Extended Key Usage" section below. The special EKU anyExtendedKeyUsage enables all uses when trusted or blocks all uses when rejected.

A certificate, which may be CA certificate or an end-entity certificate, is considered a trust anchor for the intended use if and only if all the following conditions hold:

  • It is an element of the trust store.
  • It does not have a negative trust attribute rejecting the EKU associated with the intended purpose.
  • It has a positive trust attribute accepting the EKU associated with the intended purpose or it does not have any positive trust attribute and one of the following compatibility conditions apply: It is apparently self-signed or the -partial_chain option is given (which corresponds to the X509_V_FLAG_PARTIAL_CHAIN flag being set).

πŸ”₯ Certification Path Building πŸ”₯

First, a certificate chain is built up starting from the target certificate and ending in a trust anchor. The goal is that for each certificate in the chain, except for the final one, the subject of the successor is the issuer of the former certificate. Since it often happens that the subject and issuer Distinguished Names are not unique, the subject and issuer key identifier extensions, if present in the certificates, are used to disambiguate conflicts.

The chain is built up iteratively, looking up each certificate in turn that matches as an issuer of the current "subject" certificate as described below. If there is more than one matching certificate, the algorithm uses the first certificate found that has a suitable validity period, otherwise the one with the latest expiration date of all matching certificates. For efficiency, the algorithm does not allow for backtracking, thus any further candidate issuer certificates that would match equally are ignored.

Certificate extensions are available since X.509v3, and though many are optional, some are generally recommended or required. For certificate chain building the subjectKeyIdentifier and authorityKeyIdentifier extensions are very useful. The subject alternative names (SAN) and issuer alternative names given in subjectAltName or issuerAltName extensions are not relevant for chain building.

Once a apparently self-signed certificate has been added, chain construction stops. In this case it must fully match a trust anchor, otherwise chain building fails.

A candidate issuer certificate matches a subject certificate if all of the following conditions hold:

  • Its subject Distinguished Name (DN) matches the issuer DN of the subject certificate.
  • If the subject certificate has an authority key identifier extension, each of its sub-fields equals the corresponding subject key identifier, serial number, and issuer field of the candidate issuer certificate, as far as the respective fields are present in both certificates.
  • The certificate signature algorithm used to sign the subject certificate is supported and equals the public key algorithm of the candidate issuer certificate.
    • If the issuer certificate includes a key usage restriction, it must allow for certificate signing (keyCertSign).

The lookup first searches for issuer certificates in the trust store. If it does not find a match there it consults the list of untrusted ("intermediate" CA) certificates, if provided. If one issuer certificate was found in the trust store, the list of untrusted certificates will not be consulted anymore to find further issuer certificates. Therefore, either only the root certificate or an uninterrupted chain to the root certificate must be provided in the trust store for a successful verification, if X509_V_FLAG_PARTIAL_CHAIN is not enabled.

πŸ’œ Certification Path Validation πŸ’œ

When the certificate chain building process was successful the chain components and their links are checked thoroughly.

The first step is to check that each certificate is well-formed. Part of these checks are enabled only if the -x509_strict option is given.

The second step is to check the X.509v3 extensions of every certificate for consistency with the intended specific purpose, if any. If no purpose is given explicitly then no such checks are done except for CMS signature checking, where by default "smimesign" is checked, and SSL/(D)TLS connection setup, where by default "sslserver" or "sslclient" are checked. The X.509v3 extensions of the target or "leaf" certificate must be compatible with the specified purpose. All other certificates down the chain are checked to be valid CA certificates, and possibly also further non-standard checks are performed. The precise extensions required are described in detail in the "Certificate Extensions" section below.

The third step is to check the trust settings on the last certificate or trust anchor, which typically is given as a self-signed root CA certificate. If specified, it must be trusted for the given use. For compatibility, an apparently self-signed certificate with no trust attributes is considered to be valid for all uses.

And bestie, the fourth and final step?? That's the whole vibe check on the chain itself. For every single element in the chain β€” yes, including the root CA cert β€” it takes the validity period from the notBefore and notAfter fields and checks it against the current system time. Want a different reference point than "now"? The -attime flag has you covered. It also checks the certificate signature (except for the signature of the typical self-signed root CA certificate β€” that one only gets verified if you pass -check_ss_sig). And when it's verifying a certificate signature, it peeks at the keyUsage extension of the candidate issuer certificate (if it exists) to allow digitalSignature for signing proxy certificates, or to allow keyCertSign for signing other certificates. If every operation pops off successfully, the certificate is considered valid. If any operation fails?? Not valid. Periodt.

✨ OPTIONS ✨

πŸŽ€ Trusted Certificate Options πŸŽ€

These options are all about how you hand over the certificates that can act as trust anchors for certain uses. Like we said, a collection of those is called a trust store.

Heads up bestie: OpenSSL does not ship a default set of trust anchors. Lots of Linux distros include a system default and configure OpenSSL to point at it. Mozilla maintains a very influential trust store, and you can find it at https://www.mozilla.org/en-US/about/governance/policies/security-group/certs/.

The certificates you add to the trust store get specified with these options right here:

  • -CAfile file β€” Load that file. It contains a trusted certificate in DER format, or potentially several of them if the input is in PEM format. PEM-encoded certificates can also have trust attributes set on them. ✨
  • -no-CAfile β€” Nope, don't load the default file of trusted certificates.
  • -CApath dir β€” Use the specified directory as a collection of trusted certificates, aka a trust store. Files should be named with the hash value of the X.509 SubjectName of each certificate β€” that way the library can pull out the IssuerName, hash it, and directly look up the file to grab the issuer certificate. Want the tea on making this kind of directory? See openssl-rehash(1).
  • -no-CApath β€” Don't use the default directory of trusted certificates. Bye.
  • -CAstore uri β€” Use uri as a store of CA certificates. The URI can point at a single certificate, or at a whole collection of them. With URIs in the file: scheme, this acts as -CAfile or -CApath, depending on whether the URI indicates a single file or a directory. More on the file: scheme over in ossl_store-file(7).

These certificates also get used when building the server certificate chain (for example with openssl-s_server(1)) or the client certificate chain (for example with openssl-s_time(1)).

  • -no-CAstore β€” Don't use the default store of trusted CA certificates.

πŸ’… Verification Options πŸ’…

Certificate verification can be fine-tuned with these flags, bestie. Let's get into it:

  • -verbose β€” Print extra info about the operations being performed. Chatty queen.
  • -attime timestamp β€” Do validation checks using the time specified by timestamp instead of the current system time. timestamp is the number of seconds since January 1, 1970 (aka the Unix Epoch).
  • -no_check_time β€” This one suppresses checking the validity period of certificates and CRLs against the current time. But lowkey important: if -attime is used to specify a verification time, the check is not suppressed.
  • -x509_strict β€” This disables non-compliant workarounds for broken certificates. So errors get thrown on certificates that aren't compliant with RFC 5280. When this option is set, among others, these certificate well-formedness conditions get checked:
    • CA certificates must explicitly include the keyUsage extension.
    • If a pathLenConstraint is given, the key usage keyCertSign must be allowed.
    • The pathLenConstraint must not be given for non-CA certificates.
    • The issuer name of any certificate must not be empty.
    • The subject name of CA certs, certs with keyUsage crlSign, and certs without subjectAlternativeName must not be empty.
    • If a subjectAlternativeName extension is given, it must not be empty.
    • The signatureAlgorithm field and the cert signature must be consistent.
    • The authorityKeyIdentifier must be given for X.509v3 certs unless they are apparently self-signed.
    • The subjectKeyIdentifier must be given for all X.509v3 CA certs.
  • -ignore_critical β€” Normally, if there's an unhandled critical extension present that OpenSSL doesn't support, the certificate gets rejected (as RFC5280 requires, no cap). Set this option and critical extensions get ignored instead.
  • -issuer_checks β€” Ignored. Yeah. It just vibes there.
  • -crl_check β€” Checks end-entity certificate validity by attempting to look up a valid CRL. Can't find a valid CRL? Error time.
  • -crl_check_all β€” Checks the validity of all certificates in the chain by attempting to look up valid CRLs.
  • -use_deltas β€” Enable support for delta CRLs.
  • -extended_crl β€” Enable extended CRL features like indirect CRLs and alternate CRL signing keys.
  • -suiteB_128_only, -suiteB_128, -suiteB_192 β€” Enable the Suite B mode operation at 128 bit Level of Security, 128 bit or 192 bit, or only 192 bit Level of Security, respectively. Check RFC6460 for the deets. In particular, the supported signature algorithms get reduced to support only ECDSA and SHA256 or SHA384, and only the elliptic curves P-256 and P-384.
  • -auth_level level β€” Set the certificate chain authentication security level to level. This level determines the acceptable signature and public key strength when verifying certificate chains. For a chain to validate, the public keys of all the certificates have to meet the specified security level. The signature algorithm security level is enforced for all the certificates in the chain except for the chain's trust anchor, which is either directly trusted or validated by means other than its signature. See SSL_CTX_set_security_level(3) for the definitions of the available levels. The default security level is -1, aka "not set". At security level 0 or lower, all algorithms are acceptable. Security level 1 requires at least 80-bit-equivalent security and is broadly interoperable, though it will, for example, reject MD5 signatures or RSA keys shorter than 1024 bits.
  • -partial_chain β€” Allow verification to succeed if an incomplete chain can be built. Like, a chain ending in a certificate that normally wouldn't be trusted (because it's not self-signed and has no matching positive trust attributes) but is an element of the trust store. That certificate might be self-issued or belong to an intermediate CA. πŸ™ˆ
  • -check_ss_sig β€” Verify the signature of the last certificate in a chain if the certificate is apparently self-signed. This is prohibited and will result in an error if it's a non-conforming CA certificate with key usage restrictions that don't include the keyCertSign bit. This verification is disabled by default because it doesn't add any security. Not worth it, bestie.
  • -allow_proxy_certs β€” Allow the verification of proxy certificates.
  • -trusted_first β€” This option is on by default and cannot be disabled. When constructing the certificate chain, the trusted certificates specified via -CAfile, -CApath, -CAstore or -trusted are always used before any certificates specified via -untrusted.
  • -no_alt_chains β€” Since -trusted_first is always on, this option has no effect. It's giving decorative.
  • -trusted file β€” Parse file as a set of one or more certificates. Each of them qualifies as trusted if it has a suitable positive trust attribute, or it's apparently self-signed, or the -partial_chain option is specified. This option implies the -no-CAfile, -no-CApath, and -no-CAstore options, and it cannot be used with the -CAfile, -CApath or -CAstore options β€” so the only trust anchors are the certificates specified using -trusted. This option may be used multiple times.
  • -untrusted file β€” Parse file as a set of one or more certificates. All certificates (typically of intermediate CAs) are considered untrusted and may be used to construct a certificate chain from the target certificate to a trust anchor. This option may be used multiple times.
  • -policy arg β€” Enable policy processing and add arg to the user-initial-policy-set (see RFC5280). The arg can be an object name or an OID in numeric form. This argument can appear more than once.
  • -explicit_policy β€” Set policy variable require-explicit-policy (see RFC5280).
  • -policy_check β€” Enables certificate policy processing.
  • -policy_print β€” Print out diagnostics related to policy processing.
  • -inhibit_any β€” Set policy variable inhibit-any-policy (see RFC5280).
  • -inhibit_map β€” Set policy variable inhibit-policy-mapping (see RFC5280).
  • -purpose purpose β€” A high-level specification of the intended use of the target certificate. Currently predefined purposes are sslclient, sslserver, nssslserver, smimesign, smimeencrypt, crlsign, ocsphelper, timestampsign, codesign and any. If peer certificate verification is enabled, by default the TLS implementation β€” and therefore the commands openssl-s_client(1) and openssl-s_server(1) β€” checks for consistency with TLS server (sslserver) or TLS client use (sslclient), respectively. By default, CMS signature validation, which can be done via openssl-cms(1), checks for consistency with S/MIME signing use (smimesign).

While IETF RFC 5280 says that id-kp-serverAuth and id-kp-clientAuth are only for WWW use, in practice they're used for all kinds of TLS clients and servers, and that's what OpenSSL assumes too. 🌈

For details on the checks performed, see the "Certificate Extensions" section.

  • -verify_depth num β€” Limit the certificate chain to num intermediate CA certificates. A maximal depth chain can have up to num+2 certificates, since neither the end-entity certificate nor the trust-anchor certificate count against the -verify_depth limit.
  • -verify_email email β€” Verify if email matches the email address in Subject Alternative Name or the email in the subject Distinguished Name.

  • -verify_hostname hostname β€” checks whether hostname matches the DNS name sitting in the Subject Alternative Name of the subject certificate, or in its Common Name. πŸ¦‹
  • -verify_ip ip β€” checks whether ip matches the IP address in the Subject Alternative Name of the subject certificate. no cap.
  • -verify_name name β€” pulls in a whole set of verification parameters (aka a verification method) by the name you give it. The predefined ones you can reach for right now are "ssl_client", "ssl_server", "smime_sign" (which has the alias "pkcs7"), "code_sign", and "default". These are literally mimicking the combos of purpose + trust settings that get used in SSL/(D)TLS, CMS/PKCS7 (S/MIME included bestie πŸ’Œ), and code signing. iconic behaviour fr.

The verification parameters cover the trust model, assorted flags (some of which you can also set through other command-line options), and the verification purpose β€” and the purpose in turn implies the certificate key usage and extended key usage requirements. so it's a whole vibe cascade ✨

The trust model is what decides which auxiliary trust or reject OIDs apply when verifying the given certificate chain. You can hand those over with the -addtrust and -addreject options of openssl-x509(1). πŸ’…


✨ Extended Verification Options ✨

Sometimes there's not just one certificate chain leading to an end-entity certificate β€” there can be several, and it's not a rare glitch. Usually it's because some root or intermediate CA signed a certificate for another CA in a different org. Another reason is a CA that has intermediates using two different signature formats, like a SHA-1 digest and a SHA-256 digest. two cakes, same bakery πŸŽ‚πŸŽ‚

The options below are the ones you use to feed in data that lets the OpenSSL command build an alternative chain. 🌈

  • -xkey infile, -xcert infile, -xchain β€” gives an extra certificate, an extra private key, and an extra certificate chain. These act the exact same way as the -cert, -key and -cert_chain options do. Once you specify them, the callback that returns the first valid chain is the one in use by the client. 🫢
  • -xchain_build β€” says whether the application should build the certificate chain that gets handed to the server for the extra certificates, using the -xkey, -xcert, and -xchain options.
  • -xcertform DER|PEM|P12 β€” the input format for the extra certificate. Heads up bestie: this option has no effect and is only kept around for backward compatibility. 🩻
  • -xkeyform DER|PEM|P12 β€” the input format for the extra key. Same story: no effect, retained for backward compatibility only.

πŸŽ€ Certificate Extensions πŸŽ€

Options like -purpose and -verify_name are what trigger the processing of specific certificate extensions β€” and those extensions are what decide what a certificate is even allowed to be used for. πŸ’€

Little heads-up: the next two subsections on the basicConstraints and keyUsage extensions, and the bit about X.509v1 certificates, apply to all CA certificates, no matter what purpose was required.

Basic Constraints πŸ”

The basicConstraints extension's CA flag is what determines whether a certificate can be used as a CA. If the CA flag is true, then it is a CA. If the CA flag is false, then it is not a CA. And every CA should have the CA flag set to true. periodt.

If the basicConstraints extension is absent β€” and yes, that includes the case where it's an X.509v1 certificate β€” then the certificate gets treated as a "possible CA" and other extensions get checked according to the intended use of the certificate. This whole "certs without basicConstraints get treated as a CA" situation is presently supported, but it could change in the future. so don't get too attached 😭

Key Usage πŸ”‘

If the keyUsage extension is present, then extra restraints get slapped onto how the certificate can be used. A CA certificate must have the keyCertSign bit set if the keyUsage extension is present. Further restrictions get checked depending on the required purpose, if there is one β€” the details are in the list given in the next subsection. get you a manpage that cross-references itself πŸ’…

Extended Key Usage πŸ¦‹

The extKeyUsage (EKU for the girlies) extension places additional restrictions on certificate use. If this extension is present in an end-entity certificate β€” critical or not, doesn't matter β€” the key is allowed only for the uses it specifies, while the special EKU anyExtendedKeyUsage allows for all uses. slay, loophole.

Also, fun fact from RFC 5280 section 4.2.1.12: the Extended Key Usage extension will appear only in end-entity certificates, and consequently the standard certification path validation described in its section 6 does not include EKU checks for CA certificates. Meanwhile the CA/Browser Forum requires, for TLS server, S/MIME, and code signing use, the presence of the respective EKUs in subordinate CA certificates (while excluding them for root CA certificates) β€” and it takes over from RFC 5280 the certificate validity concept and certificate path validation. we stan a committee πŸ‘‘

For historic reasons, OpenSSL has its own way of interpreting and checking EKU extensions on CA certificates, and that may change in the future. What it does is: it does not require the presence of EKU extensions in CA certificates, but when the verification purpose is "sslclient", "nssslserver", "sslserver", "smimesign", or "smimeencrypt", it checks that any present EKU extension (that does not contain anyExtendedKeyUsage) contains the respective EKU as detailed below. And on top of all that β€” it does these checks even for trust anchor certificates. obsessed with the thoroughness fr fr.

Checks Implied by Specific Predefined Policies πŸ“‹

Every single check gets its own description down below. And remember: those comments about basicConstraints and keyUsage and X.509v1 certificates above apply to all CA certificates. πŸ’–

  • (D)TLS Client ("sslclient") β€” whatever extended key usage extension you hand it must allow for "clientAuth" (that's "TLS WWW client authentication"). πŸ–₯️

For target certificates, the key usage must allow for "digitalSignature" and/or "keyAgreement". The Netscape certificate type must be absent, or have the SSL client bit set.

For all other certificates, the normal CA checks apply. Plus: the Netscape certificate type must be absent or have the SSL CA bit set. This is used as a workaround when the basicConstraints extension is absent.

  • (D)TLS Server ("sslserver") β€” any given extended key usage extension must allow for "serverAuth" (that's "TLS WWW server authentication") and/or include one of the SGC OIDs. πŸ–§

For target certificates, the key usage must allow for "digitalSignature", "keyEncipherment", and/or "keyAgreement". The Netscape certificate type must be absent or have the SSL server bit set.

For all other certificates, the normal CA checks apply. In addition, the Netscape certificate type must be absent or have the SSL CA bit set. This is used as a workaround if the basicConstraints extension is absent.

  • Netscape SSL Server ("nssslserver") β€” on top of everything already described for sslserver: for a Netscape SSL client to connect to an SSL server, its EE certificate must have the keyEncipherment bit set if the keyUsage extension is present. This isn't always valid, because some cipher suites use the key for digital signing. Otherwise it's the same as a normal SSL server. πŸ€·β€β™€οΈ
  • Common S/MIME Checks β€” any given extended key usage extension must allow for "emailProtection". πŸ“§

For target certificates, the Netscape certificate type must be absent or should have the S/MIME bit set. If the S/MIME bit is not set in the Netscape certificate type, then the SSL client bit is tolerated as an alternative β€” but a warning gets shown. Why? Because some Verisign certificates don't set the S/MIME bit. the audacity 😭

For all other certificates, the normal CA checks apply. In addition, the Netscape certificate type must be absent or have the S/MIME CA bit set. This is used as a workaround if the basicConstraints extension is absent.

  • S/MIME Signing ("smimesign") β€” in addition to the common S/MIME checks, for target certificates the key usage must allow for "digitalSignature" and/or nonRepudiation (or its alias name contentCommitment). ✍️
  • S/MIME Encryption ("smimeencrypt") β€” in addition to the common S/MIME checks, for target certificates the key usage must allow for "keyEncipherment". πŸ”’
  • CRL Signing ("crlsign") β€” for target certificates, the key usage must allow for "cRLSign".

For all other certificates, the normal CA checks apply. Except in this case, the basicConstraints extension must be present. πŸ‘€

  • OCSP Helper ("ocsphelper") β€” for target certificates, no checks are performed at this stage, but special checks apply; peep OCSP_basic_verify(3) for those. πŸ”Ž

For all other certificates, the normal CA checks apply.

  • Timestamp Signing ("timestampsign") β€” for target certificates, if the key usage extension is present, it must include "digitalSignature" and/or "nonRepudiation" (or its alias name "contentCommitment") and must not include other bits. The EKU extension must be present and contain "timeStamping" only. Moreover, it must be marked as critical. ⏰ dramatic but valid.

For all other certificates, the normal CA checks apply.

  • Code Signing ("codesign") β€” for target certificates, the key usage extension must be present and marked critical and include <digitalSignature>, but must not include "keyCertSign" nor "cRLSign". The EKU extension must be present and contain "codeSign", but must not include "anyExtendedKeyUsage" nor "serverAuth". πŸ§‘β€πŸ’»

For all other certificates, the normal CA checks apply.


πŸ’€ BUGS πŸ’€

The issuer checks still suffer from limitations in the underlying X509_LOOKUP API. Like, trusted certificates with a matching subject name must appear in a file (as specified by the -CAfile option), a directory (as specified by -CApath), or a store (as specified by -CAstore). And if there are multiple such matches β€” possibly spread across multiple locations β€” only the first one (in the mentioned order of locations) is recognised. first come, first served, I guess 😭


πŸ‘€ SEE ALSO πŸ‘€

X509_verify_cert(3), OCSP_basic_verify(3), openssl-verify(1), openssl-ocsp(1), openssl-ts(1), openssl-s_client(1), openssl-s_server(1), openssl-smime(1), openssl-cmp(1), openssl-cms(1)

the whole friend group 🫢


πŸ•°οΈ HISTORY πŸ•°οΈ

Since OpenSSL 1.1.0, the -trusted_first option is always enabled. 1.1.0 said "you don't get to turn it off" and honestly? valid.

The checks enabled by -x509_strict have been extended in OpenSSL 3.0, which has been partially reverted in OpenSSL 4.0. glow up, glow down, glow up again ✨


Copyright 2000-2026 The OpenSSL Project Authors. All Rights Reserved.

Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at <https://www.openssl.org/source/license.html>.


and that's the whole page bestie, you made it to the end πŸŽ‰ this lil masterpiece is from OpenSSL 4.0.3, dated 2026-09-29 β€” go forth and verify some certificates, you absolute icon πŸ‘‘πŸ’–πŸŒΈ

πŸ“¦ where this page comes from