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