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

NAME

6       verify - Utility to verify certificates.
7

SYNOPSIS

9       openssl verify [-CApath directory] [-CAfile file] [-purpose purpose]
10       [-untrusted file] [-help] [-issuer_checks] [-verbose] [-] [certifi‐
11       cates]
12

DESCRIPTION

14       The verify command verifies certificate chains.
15

COMMAND OPTIONS

17       -CApath directory
18           A directory of trusted certificates. The certificates should have
19           names of the form: hash.0 or have symbolic links to them of this
20           form ("hash" is the hashed certificate subject name: see the -hash
21           option of the x509 utility). Under Unix the c_rehash script will
22           automatically create symbolic links to a directory of certificates.
23
24       -CAfile file
25           A file of trusted certificates. The file should contain multiple
26           certificates in PEM format concatenated together.
27
28       -untrusted file
29           A file of untrusted certificates. The file should contain multiple
30           certificates
31
32       -purpose purpose
33           the intended use for the certificate. Without this option no chain
34           verification will be done. Currently accepted uses are sslclient,
35           sslserver, nssslserver, smimesign, smimeencrypt. See the VERIFY
36           OPERATION section for more information.
37
38       -help
39           prints out a usage message.
40
41       -verbose
42           print extra information about the operations being performed.
43
44       -issuer_checks
45           print out diagnostics relating to searches for the issuer certifi‐
46           cate of the current certificate. This shows why each candidate
47           issuer certificate was rejected. However the presence of rejection
48           messages does not itself imply that anything is wrong: during the
49           normal verify process several rejections may take place.
50
51       -   marks the last option. All arguments following this are assumed to
52           be certificate files. This is useful if the first certificate file‐
53           name begins with a -.
54
55       certificates
56           one or more certificates to verify. If no certificate filenames are
57           included then an attempt is made to read a certificate from stan‐
58           dard input. They should all be in PEM format.
59

VERIFY OPERATION

61       The verify program uses the same functions as the internal SSL and
62       S/MIME verification, therefore this description applies to these verify
63       operations too.
64
65       There is one crucial difference between the verify operations performed
66       by the verify program: wherever possible an attempt is made to continue
67       after an error whereas normally the verify operation would halt on the
68       first error. This allows all the problems with a certificate chain to
69       be determined.
70
71       The verify operation consists of a number of separate steps.
72
73       Firstly a certificate chain is built up starting from the supplied cer‐
74       tificate and ending in the root CA. It is an error if the whole chain
75       cannot be built up. The chain is built up by looking up the issuers
76       certificate of the current certificate. If a certificate is found which
77       is its own issuer it is assumed to be the root CA.
78
79       The process of 'looking up the issuers certificate' itself involves a
80       number of steps. In versions of OpenSSL before 0.9.5a the first cer‐
81       tificate whose subject name matched the issuer of the current certifi‐
82       cate was assumed to be the issuers certificate. In OpenSSL 0.9.6 and
83       later all certificates whose subject name matches the issuer name of
84       the current certificate are subject to further tests. The relevant
85       authority key identifier components of the current certificate (if
86       present) must match the subject key identifier (if present) and issuer
87       and serial number of the candidate issuer, in addition the keyUsage
88       extension of the candidate issuer (if present) must permit certificate
89       signing.
90
91       The lookup first looks in the list of untrusted certificates and if no
92       match is found the remaining lookups are from the trusted certificates.
93       The root CA is always looked up in the trusted certificate list: if the
94       certificate to verify is a root certificate then an exact match must be
95       found in the trusted list.
96
97       The second operation is to check every untrusted certificate's exten‐
98       sions for consistency with the supplied purpose. If the -purpose option
99       is not included then no checks are done. The supplied or "leaf" cer‐
100       tificate must have extensions compatible with the supplied purpose and
101       all other certificates must also be valid CA certificates. The precise
102       extensions required are described in more detail in the CERTIFICATE
103       EXTENSIONS section of the x509 utility.
104
105       The third operation is to check the trust settings on the root CA. The
106       root CA should be trusted for the supplied purpose. For compatibility
107       with previous versions of SSLeay and OpenSSL a certificate with no
108       trust settings is considered to be valid for all purposes.
109
110       The final operation is to check the validity of the certificate chain.
111       The validity period is checked against the current system time and the
112       notBefore and notAfter dates in the certificate. The certificate signa‐
113       tures are also checked at this point.
114
115       If all operations complete successfully then certificate is considered
116       valid. If any operation fails then the certificate is not valid.
117

DIAGNOSTICS

119       When a verify operation fails the output messages can be somewhat cryp‐
120       tic. The general form of the error message is:
121
122        server.pem: /C=AU/ST=Queensland/O=CryptSoft Pty Ltd/CN=Test CA (1024 bit)
123        error 24 at 1 depth lookup:invalid CA certificate
124
125       The first line contains the name of the certificate being verified fol‐
126       lowed by the subject name of the certificate. The second line contains
127       the error number and the depth. The depth is number of the certificate
128       being verified when a problem was detected starting with zero for the
129       certificate being verified itself then 1 for the CA that signed the
130       certificate and so on. Finally a text version of the error number is
131       presented.
132
133       An exhaustive list of the error codes and messages is shown below, this
134       also includes the name of the error code as defined in the header file
135       x509_vfy.h Some of the error codes are defined but never returned:
136       these are described as "unused".
137
138       0 X509_V_OK: ok
139           the operation was successful.
140
141       2 X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT: unable to get issuer certifi‐
142       cate
143           the issuer certificate could not be found: this occurs if the
144           issuer certificate of an untrusted certificate cannot be found.
145
146       3 X509_V_ERR_UNABLE_TO_GET_CRL unable to get certificate CRL
147           the CRL of a certificate could not be found. Unused.
148
149       4 X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE: unable to decrypt cer‐
150       tificate's signature
151           the certificate signature could not be decrypted. This means that
152           the actual signature value could not be determined rather than it
153           not matching the expected value, this is only meaningful for RSA
154           keys.
155
156       5 X509_V_ERR_UNABLE_TO_DECRYPT_CRL_SIGNATURE: unable to decrypt CRL's
157       signature
158           the CRL signature could not be decrypted: this means that the
159           actual signature value could not be determined rather than it not
160           matching the expected value. Unused.
161
162       6 X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY: unable to decode
163       issuer public key
164           the public key in the certificate SubjectPublicKeyInfo could not be
165           read.
166
167       7 X509_V_ERR_CERT_SIGNATURE_FAILURE: certificate signature failure
168           the signature of the certificate is invalid.
169
170       8 X509_V_ERR_CRL_SIGNATURE_FAILURE: CRL signature failure
171           the signature of the certificate is invalid. Unused.
172
173       9 X509_V_ERR_CERT_NOT_YET_VALID: certificate is not yet valid
174           the certificate is not yet valid: the notBefore date is after the
175           current time.
176
177       10 X509_V_ERR_CERT_HAS_EXPIRED: certificate has expired
178           the certificate has expired: that is the notAfter date is before
179           the current time.
180
181       11 X509_V_ERR_CRL_NOT_YET_VALID: CRL is not yet valid
182           the CRL is not yet valid. Unused.
183
184       12 X509_V_ERR_CRL_HAS_EXPIRED: CRL has expired
185           the CRL has expired. Unused.
186
187       13 X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD: format error in certifi‐
188       cate's notBefore field
189           the certificate notBefore field contains an invalid time.
190
191       14 X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD: format error in certifi‐
192       cate's notAfter field
193           the certificate notAfter field contains an invalid time.
194
195       15 X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD: format error in CRL's
196       lastUpdate field
197           the CRL lastUpdate field contains an invalid time. Unused.
198
199       16 X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD: format error in CRL's
200       nextUpdate field
201           the CRL nextUpdate field contains an invalid time. Unused.
202
203       17 X509_V_ERR_OUT_OF_MEM: out of memory
204           an error occurred trying to allocate memory. This should never hap‐
205           pen.
206
207       18 X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT: self signed certificate
208           the passed certificate is self signed and the same certificate can‐
209           not be found in the list of trusted certificates.
210
211       19 X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN: self signed certificate in
212       certificate chain
213           the certificate chain could be built up using the untrusted cer‐
214           tificates but the root could not be found locally.
215
216       20 X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY: unable to get local
217       issuer certificate
218           the issuer certificate of a locally looked up certificate could not
219           be found. This normally means the list of trusted certificates is
220           not complete.
221
222       21 X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE: unable to verify the
223       first certificate
224           no signatures could be verified because the chain contains only one
225           certificate and it is not self signed.
226
227       22 X509_V_ERR_CERT_CHAIN_TOO_LONG: certificate chain too long
228           the certificate chain length is greater than the supplied maximum
229           depth. Unused.
230
231       23 X509_V_ERR_CERT_REVOKED: certificate revoked
232           the certificate has been revoked. Unused.
233
234       24 X509_V_ERR_INVALID_CA: invalid CA certificate
235           a CA certificate is invalid. Either it is not a CA or its exten‐
236           sions are not consistent with the supplied purpose.
237
238       25 X509_V_ERR_PATH_LENGTH_EXCEEDED: path length constraint exceeded
239           the basicConstraints pathlength parameter has been exceeded.
240
241       26 X509_V_ERR_INVALID_PURPOSE: unsupported certificate purpose
242           the supplied certificate cannot be used for the specified purpose.
243
244       27 X509_V_ERR_CERT_UNTRUSTED: certificate not trusted
245           the root CA is not marked as trusted for the specified purpose.
246
247       28 X509_V_ERR_CERT_REJECTED: certificate rejected
248           the root CA is marked to reject the specified purpose.
249
250       29 X509_V_ERR_SUBJECT_ISSUER_MISMATCH: subject issuer mismatch
251           the current candidate issuer certificate was rejected because its
252           subject name did not match the issuer name of the current certifi‐
253           cate. Only displayed when the -issuer_checks option is set.
254
255       30 X509_V_ERR_AKID_SKID_MISMATCH: authority and subject key identifier
256       mismatch
257           the current candidate issuer certificate was rejected because its
258           subject key identifier was present and did not match the authority
259           key identifier current certificate. Only displayed when the
260           -issuer_checks option is set.
261
262       31 X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH: authority and issuer serial
263       number mismatch
264           the current candidate issuer certificate was rejected because its
265           issuer name and serial number was present and did not match the
266           authority key identifier of the current certificate. Only displayed
267           when the -issuer_checks option is set.
268
269       32 X509_V_ERR_KEYUSAGE_NO_CERTSIGN:key usage does not include certifi‐
270       cate signing
271           the current candidate issuer certificate was rejected because its
272           keyUsage extension does not permit certificate signing.
273
274       50 X509_V_ERR_APPLICATION_VERIFICATION: application verification fail‐
275       ure
276           an application specific error. Unused.
277

BUGS

279       Although the issuer checks are a considerably improvement over the old
280       technique they still suffer from limitations in the underlying
281       X509_LOOKUP API. One consequence of this is that trusted certificates
282       with matching subject name must either appear in a file (as specified
283       by the -CAfile option) or a directory (as specified by -CApath. If they
284       occur in both then only the certificates in the file will be recog‐
285       nised.
286
287       Previous versions of OpenSSL assume certificates with matching subject
288       name are identical and mishandled them.
289

SEE ALSO

291       x509(1)
292
293
294
2950.9.8b                            2001-10-08                         VERIFY(1)
Impressum