NAME

openssl-verify - Utility to verify certificates


SYNOPSIS

openssl verify [-help] [-CRLfile file] [-crl_download] [-show_chain] [-sm2-id hexstring] [-sm2-hex-id hexstring] [-verbose] [-trusted file] [-untrusted file] [-nameopt option] [-CAfile file] [-no-CAfile] [-CApath dir] [-no-CApath] [-CAstore uri] [-no-CAstore] [-engine id] [-allow_proxy_certs] [-attime timestamp] [-no_check_time] [-check_ss_sig] [-crl_check] [-crl_check_all] [-explicit_policy] [-extended_crl] [-ignore_critical] [-inhibit_any] [-inhibit_map] [-partial_chain] [-policy arg] [-policy_check] [-policy_print] [-purpose purpose] [-suiteB_128] [-suiteB_128_only] [-suiteB_192] [-trusted_first] [-no_alt_chains] [-use_deltas] [-auth_level num] [-verify_depth num] [-verify_email email] [-verify_hostname hostname] [-verify_ip ip] [-verify_name name] [-x509_strict] [-issuer_checks]

[--] [certificate ...]


DESCRIPTION

This command verifies certificate chains.


OPTIONS

-help

Print out a usage message.

-CAfile file, -no-CAfile, -CApath dir, -no-CApath

See openssl(1)/Trusted Certificate Options for more information.

-CRLfile file

The file should contain one or more CRLs in PEM format. This option can be specified more than once to include CRLs from multiple files.

-crl_download

Attempt to download CRL information for this certificate.

-show_chain

Display information about the certificate chain that has been built (if successful). Certificates in the chain that came from the untrusted list will be flagged as "untrusted".

-sm2-id hexstring

Specify the ID string to use when verifying an SM2 certificate. The ID string is required by the SM2 signature algorithm for signing and verification.

-sm2-hex-id hexstring

Specify a binary ID string to use when signing or verifying using an SM2 certificate. The argument for this option is string of hexadecimal digits.

-verbose

Print extra information about the operations being performed.

-trusted file

A file of trusted certificates.

-untrusted file

A file of untrusted certificates.

-nameopt option

This specifies how the subject or issuer names are displayed. See openssl(1)/Name Format Options for details.

-engine id

See openssl(1)/Engine Options. To load certificates or CRLs that require engine support, specify the -engine option before any of the -trusted, -untrusted or -CRLfile options.

-CAfile file, -no-CAfile, -CApath dir, -no-CApath, -CAstore uri, -no-CAstore

See openssl(1)/Trusted Certificate Options for details.

-allow_proxy_certs, -attime, -no_check_time, -check_ss_sig, -crl_check, -crl_check_all, -explicit_policy, -extended_crl, -ignore_critical, -inhibit_any, -inhibit_map, -no_alt_chains, -partial_chain, -policy, -policy_check, -policy_print, -purpose, -suiteB_128, -suiteB_128_only, -suiteB_192, -trusted_first, -use_deltas, -auth_level, -verify_depth, -verify_email, -verify_hostname, -verify_ip, -verify_name, -x509_strict -issuer_checks

Set various options of certificate chain verification. See openssl(1)/Verification Options for details.

--

Indicates the last option. All arguments following this are assumed to be certificate files. This is useful if the first certificate filename begins with a -.

certificate ...

One or more certificates to verify. If no certificates are given, this command will attempt to read a certificate from standard input. Certificates must be in PEM format. If a certificate chain has multiple problems, this program tries to display all of them.


DIAGNOSTICS

When a verify operation fails the output messages can be somewhat cryptic. The general form of the error message is:

 server.pem: /C=AU/ST=Queensland/O=CryptSoft Pty Ltd/CN=Test CA (1024 bit)
 error 24 at 1 depth lookup:invalid CA certificate

The first line contains the name of the certificate being verified followed by the subject name of the certificate. The second line contains the error number and the depth. The depth is number of the certificate being verified when a problem was detected starting with zero for the certificate being verified itself then 1 for the CA that signed the certificate and so on. Finally a text version of the error number is presented.

A list of the error codes and messages can be found in X509_STORE_CTX_get_error(3); the full list is defined in the header file <openssl/x509_vfy.h >>.

This command ignores many errors, in order to allow all the problems with a certificate chain to be determined.


BUGS

Although the issuer checks are a considerable improvement over the old technique they still suffer from limitations in the underlying X509_LOOKUP API. One consequence of this is that trusted certificates with matching subject name must either appear in a file (as specified by the -CAfile option), a directory (as specified by -CApath), or a store (as specified by -CAstore). If they occur in more than one location then only the certificates in the file will be recognised.

Previous versions of OpenSSL assume certificates with matching subject name are identical and mishandled them.

Previous versions of this documentation swapped the meaning of the X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT and X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY error codes.


SEE ALSO

openssl(1), openssl-x509(1), ossl_store-file(7)


HISTORY

The -show_chain option was added in OpenSSL 1.1.0.

The -sm2-id and -sm2-hex-id options were added in OpenSSL 3.0.


COPYRIGHT

Copyright 2000-2019 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.