8a807d21f6c7cc4c70f5fac5be7a58c4841e6908
[openssl.git] / doc / man1 / openssl-verify.pod.in
1 =pod
2 {- OpenSSL::safe::output_do_not_edit_headers(); -}
3
4 =head1 NAME
5
6 openssl-verify - certificate verification command
7
8 =head1 SYNOPSIS
9
10 B<openssl> B<verify>
11 [B<-help>]
12 [B<-CRLfile> I<file>]
13 [B<-crl_download>]
14 [B<-show_chain>]
15 [B<-verbose>]
16 [B<-trusted> I<file>]
17 [B<-untrusted> I<file>]
18 [B<-vfyopt> I<nm>:I<v>]
19 {- $OpenSSL::safe::opt_name_synopsis -}
20 {- $OpenSSL::safe::opt_trust_synopsis -}
21 {- $OpenSSL::safe::opt_engine_synopsis -}{- $OpenSSL::safe::opt_v_synopsis -}
22 {- $OpenSSL::safe::opt_provider_synopsis -}
23 [B<-->]
24 [I<certificate> ...]
25
26 =for openssl ifdef engine
27
28 =head1 DESCRIPTION
29
30 This command verifies certificate chains. If a certificate chain has multiple
31 problems, this program attempts to display all of them.
32
33 =head1 OPTIONS
34
35 =over 4
36
37 =item B<-help>
38
39 Print out a usage message.
40
41 =item B<-CRLfile> I<file>
42
43 The file or URI should contain one or more CRLs in PEM or DER format.
44 This option can be specified more than once to include CRLs from multiple
45 I<file>s.
46
47 =item B<-crl_download>
48
49 Attempt to download CRL information for certificates via their CDP entries.
50
51 =item B<-show_chain>
52
53 Display information about the certificate chain that has been built (if
54 successful). Certificates in the chain that came from the untrusted list will be
55 flagged as "untrusted".
56
57 =item B<-verbose>
58
59 Print extra information about the operations being performed.
60
61 =item B<-trusted> I<file>
62
63 A file or URI of trusted certificates in PEM, DER, or PKCS#12 format.
64 This option can be specified more than once to load certificates from multiple
65 I<file>s.
66
67 =item B<-untrusted> I<file>
68
69 A file or URI of untrusted certificates in PEM, DER, or PKCS#12 format
70 to use for chain building.
71 This option can be specified more than once to load certificates from multiple
72 I<file>s.
73
74
75 =item B<-vfyopt> I<nm>:I<v>
76
77 Pass options to the signature algorithm during verify operations.
78 Names and values of these options are algorithm-specific.
79
80 {- $OpenSSL::safe::opt_name_item -}
81
82 {- $OpenSSL::safe::opt_engine_item -}
83 {- output_off() if $disabled{"deprecated-3.0"}; "" -}
84 To load certificates or CRLs that require engine support, specify the
85 B<-engine> option before any of the
86 B<-trusted>, B<-untrusted> or B<-CRLfile> options.
87 {- output_on() if $disabled{"deprecated-3.0"}; "" -}
88
89 {- $OpenSSL::safe::opt_trust_item -}
90
91 {- $OpenSSL::safe::opt_v_item -}
92
93 {- $OpenSSL::safe::opt_provider_item -}
94
95 =item B<-->
96
97 Indicates the last option. All arguments following this are assumed to be
98 certificate files. This is useful if the first certificate filename begins
99 with a B<->.
100
101 =item I<certificate> ...
102
103 One or more target certificates to verify, one per file. If no certificates are
104 given, this command will attempt to read a single certificate from standard
105 input.
106
107 =back
108
109 =head1 DIAGNOSTICS
110
111 When a verify operation fails the output messages can be somewhat cryptic. The
112 general form of the error message is:
113
114  server.pem: /C=AU/ST=Queensland/O=CryptSoft Pty Ltd/CN=Test CA (1024 bit)
115  error 24 at 1 depth lookup:invalid CA certificate
116
117 The first line contains the name of the certificate being verified followed by
118 the subject name of the certificate. The second line contains the error number
119 and the depth. The depth is number of the certificate being verified when a
120 problem was detected starting with zero for the target ("leaf") certificate
121 itself then 1 for the CA that signed the target certificate and so on.
122 Finally a textual version of the error number is presented.
123
124 A list of the error codes and messages can be found in
125 L<X509_STORE_CTX_get_error(3)>; the full list is defined in the header file
126 F<< <openssl/x509_vfy.h> >>.
127
128 This command ignores many errors, in order to allow all the problems with a
129 certificate chain to be determined.
130
131 =head1 BUGS
132
133 Although the issuer checks are a considerable improvement over the old
134 technique they still suffer from limitations in the underlying X509_LOOKUP
135 API. One consequence of this is that trusted certificates with matching
136 subject name must either appear in a file (as specified by the B<-CAfile>
137 option), a directory (as specified by B<-CApath>), or a store (as specified
138 by B<-CAstore>). If they occur in more than one location then only the
139 certificates in the file will be recognised.
140
141 Previous versions of OpenSSL assume certificates with matching subject
142 name are identical and mishandled them.
143
144 Previous versions of this documentation swapped the meaning of the
145 B<X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT> and
146 B<X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY> error codes.
147
148 =head1 SEE ALSO
149
150 L<openssl-verification-options(1)>,
151 L<openssl-x509(1)>,
152 L<ossl_store-file(7)>
153
154 =head1 HISTORY
155
156 The B<-show_chain> option was added in OpenSSL 1.1.0.
157
158 The B<-engine option> was deprecated in OpenSSL 3.0.
159
160 =head1 COPYRIGHT
161
162 Copyright 2000-2021 The OpenSSL Project Authors. All Rights Reserved.
163
164 Licensed under the Apache License 2.0 (the "License").  You may not use
165 this file except in compliance with the License.  You can obtain a copy
166 in the file LICENSE in the source distribution or at
167 L<https://www.openssl.org/source/license.html>.
168
169 =cut