1VERIFY(1)                           OpenSSL                          VERIFY(1)
2
3
4

NAME

6       verify - Utility to verify certificates.
7

SYNOPSIS

9       openssl verify [-CApath directory] [-CAfile file] [-trusted_first]
10       [-purpose purpose] [-policy arg] [-ignore_critical] [-attime timestamp]
11       [-check_ss_sig] [-crlfile file] [-crl_download] [-crl_check]
12       [-crl_check_all] [-policy_check] [-explicit_policy] [-inhibit_any]
13       [-inhibit_map] [-x509_strict] [-extended_crl] [-use_deltas]
14       [-policy_print] [-no_alt_chains] [-allow_proxy_certs] [-untrusted file]
15       [-help] [-issuer_checks] [-trusted file] [-verbose] [-] [certificates]
16

DESCRIPTION

18       The verify command verifies certificate chains.
19

COMMAND OPTIONS

21       -CApath directory
22           A directory of trusted certificates. The certificates should have
23           names of the form: hash.0 or have symbolic links to them of this
24           form ("hash" is the hashed certificate subject name: see the -hash
25           option of the x509 utility). Under Unix the c_rehash script will
26           automatically create symbolic links to a directory of certificates.
27
28       -CAfile file A file of trusted certificates. The file should contain
29       multiple certificates in PEM format concatenated together.
30       -attime timestamp
31           Perform validation checks using time specified by timestamp and not
32           current system time. timestamp is the number of seconds since
33           01.01.1970 (UNIX time).
34
35       -check_ss_sig
36           Verify the signature on the self-signed root CA. This is disabled
37           by default because it doesn't add any security.
38
39       -crlfile file
40           File containing one or more CRL's (in PEM format) to load.
41
42       -crl_download
43           Attempt to download CRL information for this certificate.
44
45       -crl_check
46           Checks end entity certificate validity by attempting to look up a
47           valid CRL.  If a valid CRL cannot be found an error occurs.
48
49       -untrusted file
50           A file of untrusted certificates. The file should contain multiple
51           certificates in PEM format concatenated together.
52
53       -trusted_first
54           Use certificates in CA file or CA directory before the certificates
55           in the untrusted file when building the trust chain to verify
56           certificates.  This is mainly useful in environments with Bridge CA
57           or Cross-Certified CAs.
58
59       -purpose purpose
60           The intended use for the certificate. If this option is not
61           specified, verify will not consider certificate purpose during
62           chain verification.  Currently accepted uses are sslclient,
63           sslserver, nssslserver, smimesign, smimeencrypt. See the VERIFY
64           OPERATION section for more information.
65
66       -help
67           Print out a usage message.
68
69       -verbose
70           Print extra information about the operations being performed.
71
72       -issuer_checks
73           Print out diagnostics relating to searches for the issuer
74           certificate of the current certificate. This shows why each
75           candidate issuer certificate was rejected. The presence of
76           rejection messages does not itself imply that anything is wrong;
77           during the normal verification process, several rejections may take
78           place.
79
80       -policy arg
81           Enable policy processing and add arg to the user-initial-policy-set
82           (see RFC5280). The policy arg can be an object name an OID in
83           numeric form.  This argument can appear more than once.
84
85       -policy_check
86           Enables certificate policy processing.
87
88       -explicit_policy
89           Set policy variable require-explicit-policy (see RFC5280).
90
91       -inhibit_any
92           Set policy variable inhibit-any-policy (see RFC5280).
93
94       -inhibit_map
95           Set policy variable inhibit-policy-mapping (see RFC5280).
96
97       -no_alt_chains
98           When building a certificate chain, if the first certificate chain
99           found is not trusted, then OpenSSL will continue to check to see if
100           an alternative chain can be found that is trusted. With this option
101           that behaviour is suppressed so that only the first chain found is
102           ever used. Using this option will force the behaviour to match that
103           of previous OpenSSL versions.
104
105       -allow_proxy_certs
106           Allow the verification of proxy certificates.
107
108       -trusted file
109           A file of additional trusted certificates. The file should contain
110           multiple certificates in PEM format concatenated together.
111
112       -policy_print
113           Print out diagnostics related to policy processing.
114
115       -crl_check
116           Checks end entity certificate validity by attempting to look up a
117           valid CRL.  If a valid CRL cannot be found an error occurs.
118
119       -crl_check_all
120           Checks the validity of all certificates in the chain by attempting
121           to look up valid CRLs.
122
123       -ignore_critical
124           Normally if an unhandled critical extension is present which is not
125           supported by OpenSSL the certificate is rejected (as required by
126           RFC5280).  If this option is set critical extensions are ignored.
127
128       -x509_strict
129           For strict X.509 compliance, disable non-compliant workarounds for
130           broken certificates.
131
132       -extended_crl
133           Enable extended CRL features such as indirect CRLs and alternate
134           CRL signing keys.
135
136       -use_deltas
137           Enable support for delta CRLs.
138
139       -check_ss_sig
140           Verify the signature on the self-signed root CA. This is disabled
141           by default because it doesn't add any security.
142
143       -   Indicates the last option. All arguments following this are assumed
144           to be certificate files. This is useful if the first certificate
145           filename begins with a -.
146
147       certificates
148           One or more certificates to verify. If no certificates are given,
149           verify will attempt to read a certificate from standard input.
150           Certificates must be in PEM format.
151

VERIFY OPERATION

153       The verify program uses the same functions as the internal SSL and
154       S/MIME verification, therefore this description applies to these verify
155       operations too.
156
157       There is one crucial difference between the verify operations performed
158       by the verify program: wherever possible an attempt is made to continue
159       after an error whereas normally the verify operation would halt on the
160       first error. This allows all the problems with a certificate chain to
161       be determined.
162
163       The verify operation consists of a number of separate steps.
164
165       Firstly a certificate chain is built up starting from the supplied
166       certificate and ending in the root CA. It is an error if the whole
167       chain cannot be built up. The chain is built up by looking up the
168       issuers certificate of the current certificate. If a certificate is
169       found which is its own issuer it is assumed to be the root CA.
170
171       The process of 'looking up the issuers certificate' itself involves a
172       number of steps. In versions of OpenSSL before 0.9.5a the first
173       certificate whose subject name matched the issuer of the current
174       certificate was assumed to be the issuers certificate. In OpenSSL 0.9.6
175       and later all certificates whose subject name matches the issuer name
176       of the current certificate are subject to further tests. The relevant
177       authority key identifier components of the current certificate (if
178       present) must match the subject key identifier (if present) and issuer
179       and serial number of the candidate issuer, in addition the keyUsage
180       extension of the candidate issuer (if present) must permit certificate
181       signing.
182
183       The lookup first looks in the list of untrusted certificates and if no
184       match is found the remaining lookups are from the trusted certificates.
185       The root CA is always looked up in the trusted certificate list: if the
186       certificate to verify is a root certificate then an exact match must be
187       found in the trusted list.
188
189       The second operation is to check every untrusted certificate's
190       extensions for consistency with the supplied purpose. If the -purpose
191       option is not included then no checks are done. The supplied or "leaf"
192       certificate must have extensions compatible with the supplied purpose
193       and all other certificates must also be valid CA certificates. The
194       precise extensions required are described in more detail in the
195       CERTIFICATE EXTENSIONS section of the x509 utility.
196
197       The third operation is to check the trust settings on the root CA. The
198       root CA should be trusted for the supplied purpose. For compatibility
199       with previous versions of SSLeay and OpenSSL a certificate with no
200       trust settings is considered to be valid for all purposes.
201
202       The final operation is to check the validity of the certificate chain.
203       The validity period is checked against the current system time and the
204       notBefore and notAfter dates in the certificate. The certificate
205       signatures are also checked at this point.
206
207       If all operations complete successfully then certificate is considered
208       valid. If any operation fails then the certificate is not valid.
209

DIAGNOSTICS

211       When a verify operation fails the output messages can be somewhat
212       cryptic. The general form of the error message is:
213
214        server.pem: /C=AU/ST=Queensland/O=CryptSoft Pty Ltd/CN=Test CA (1024 bit)
215        error 24 at 1 depth lookup:invalid CA certificate
216
217       The first line contains the name of the certificate being verified
218       followed by the subject name of the certificate. The second line
219       contains the error number and the depth. The depth is number of the
220       certificate being verified when a problem was detected starting with
221       zero for the certificate being verified itself then 1 for the CA that
222       signed the certificate and so on. Finally a text version of the error
223       number is presented.
224
225       An exhaustive list of the error codes and messages is shown below, this
226       also includes the name of the error code as defined in the header file
227       x509_vfy.h Some of the error codes are defined but never returned:
228       these are described as "unused".
229
230       0 X509_V_OK: ok
231           the operation was successful.
232
233       2 X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT: unable to get issuer
234       certificate
235           the issuer certificate of a looked up certificate could not be
236           found. This normally means the list of trusted certificates is not
237           complete.
238
239       3 X509_V_ERR_UNABLE_TO_GET_CRL: unable to get certificate CRL
240           the CRL of a certificate could not be found.
241
242       4 X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE: unable to decrypt
243       certificate's signature
244           the certificate signature could not be decrypted. This means that
245           the actual signature value could not be determined rather than it
246           not matching the expected value, this is only meaningful for RSA
247           keys.
248
249       5 X509_V_ERR_UNABLE_TO_DECRYPT_CRL_SIGNATURE: unable to decrypt CRL's
250       signature
251           the CRL signature could not be decrypted: this means that the
252           actual signature value could not be determined rather than it not
253           matching the expected value. Unused.
254
255       6 X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY: unable to decode
256       issuer public key
257           the public key in the certificate SubjectPublicKeyInfo could not be
258           read.
259
260       7 X509_V_ERR_CERT_SIGNATURE_FAILURE: certificate signature failure
261           the signature of the certificate is invalid.
262
263       8 X509_V_ERR_CRL_SIGNATURE_FAILURE: CRL signature failure
264           the signature of the certificate is invalid.
265
266       9 X509_V_ERR_CERT_NOT_YET_VALID: certificate is not yet valid
267           the certificate is not yet valid: the notBefore date is after the
268           current time.
269
270       10 X509_V_ERR_CERT_HAS_EXPIRED: certificate has expired
271           the certificate has expired: that is the notAfter date is before
272           the current time.
273
274       11 X509_V_ERR_CRL_NOT_YET_VALID: CRL is not yet valid
275           the CRL is not yet valid.
276
277       12 X509_V_ERR_CRL_HAS_EXPIRED: CRL has expired
278           the CRL has expired.
279
280       13 X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD: format error in
281       certificate's notBefore field
282           the certificate notBefore field contains an invalid time.
283
284       14 X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD: format error in
285       certificate's notAfter field
286           the certificate notAfter field contains an invalid time.
287
288       15 X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD: format error in CRL's
289       lastUpdate field
290           the CRL lastUpdate field contains an invalid time.
291
292       16 X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD: format error in CRL's
293       nextUpdate field
294           the CRL nextUpdate field contains an invalid time.
295
296       17 X509_V_ERR_OUT_OF_MEM: out of memory
297           an error occurred trying to allocate memory. This should never
298           happen.
299
300       18 X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT: self signed certificate
301           the passed certificate is self signed and the same certificate
302           cannot be found in the list of trusted certificates.
303
304       19 X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN: self signed certificate in
305       certificate chain
306           the certificate chain could be built up using the untrusted
307           certificates but the root could not be found locally.
308
309       20 X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY: unable to get local
310       issuer certificate
311           the issuer certificate could not be found: this occurs if the
312           issuer certificate of an untrusted certificate cannot be found.
313
314       21 X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE: unable to verify the
315       first certificate
316           no signatures could be verified because the chain contains only one
317           certificate and it is not self signed.
318
319       22 X509_V_ERR_CERT_CHAIN_TOO_LONG: certificate chain too long
320           the certificate chain length is greater than the supplied maximum
321           depth. Unused.
322
323       23 X509_V_ERR_CERT_REVOKED: certificate revoked
324           the certificate has been revoked.
325
326       24 X509_V_ERR_INVALID_CA: invalid CA certificate
327           a CA certificate is invalid. Either it is not a CA or its
328           extensions are not consistent with the supplied purpose.
329
330       25 X509_V_ERR_PATH_LENGTH_EXCEEDED: path length constraint exceeded
331           the basicConstraints pathlength parameter has been exceeded.
332
333       26 X509_V_ERR_INVALID_PURPOSE: unsupported certificate purpose
334           the supplied certificate cannot be used for the specified purpose.
335
336       27 X509_V_ERR_CERT_UNTRUSTED: certificate not trusted
337           the root CA is not marked as trusted for the specified purpose.
338
339       28 X509_V_ERR_CERT_REJECTED: certificate rejected
340           the root CA is marked to reject the specified purpose.
341
342       29 X509_V_ERR_SUBJECT_ISSUER_MISMATCH: subject issuer mismatch
343           the current candidate issuer certificate was rejected because its
344           subject name did not match the issuer name of the current
345           certificate. Only displayed when the -issuer_checks option is set.
346
347       30 X509_V_ERR_AKID_SKID_MISMATCH: authority and subject key identifier
348       mismatch
349           the current candidate issuer certificate was rejected because its
350           subject key identifier was present and did not match the authority
351           key identifier current certificate. Only displayed when the
352           -issuer_checks option is set.
353
354       31 X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH: authority and issuer serial
355       number mismatch
356           the current candidate issuer certificate was rejected because its
357           issuer name and serial number was present and did not match the
358           authority key identifier of the current certificate. Only displayed
359           when the -issuer_checks option is set.
360
361       32 X509_V_ERR_KEYUSAGE_NO_CERTSIGN:key usage does not include
362       certificate signing
363           the current candidate issuer certificate was rejected because its
364           keyUsage extension does not permit certificate signing.
365
366       50 X509_V_ERR_APPLICATION_VERIFICATION: application verification
367       failure
368           an application specific error. Unused.
369

BUGS

371       Although the issuer checks are a considerable improvement over the old
372       technique they still suffer from limitations in the underlying
373       X509_LOOKUP API. One consequence of this is that trusted certificates
374       with matching subject name must either appear in a file (as specified
375       by the -CAfile option) or a directory (as specified by -CApath. If they
376       occur in both then only the certificates in the file will be
377       recognised.
378
379       Previous versions of OpenSSL assume certificates with matching subject
380       name are identical and mishandled them.
381
382       Previous versions of this documentation swapped the meaning of the
383       X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT and 20
384       X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY error codes.
385

SEE ALSO

387       x509(1)
388

HISTORY

390       The -no_alt_chains options was first added to OpenSSL 1.0.2b.
391
392
393
3941.0.2k                            2019-03-12                         VERIFY(1)
Impressum