]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - secure/usr.bin/openssl/man/verify.1
MFC: r359060, r359061, r359066
[FreeBSD/FreeBSD.git] / secure / usr.bin / openssl / man / verify.1
1 .\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.40)
2 .\"
3 .\" Standard preamble:
4 .\" ========================================================================
5 .de Sp \" Vertical space (when we can't use .PP)
6 .if t .sp .5v
7 .if n .sp
8 ..
9 .de Vb \" Begin verbatim text
10 .ft CW
11 .nf
12 .ne \\$1
13 ..
14 .de Ve \" End verbatim text
15 .ft R
16 .fi
17 ..
18 .\" Set up some character translations and predefined strings.  \*(-- will
19 .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
20 .\" double quote, and \*(R" will give a right double quote.  \*(C+ will
21 .\" give a nicer C++.  Capital omega is used to do unbreakable dashes and
22 .\" therefore won't be available.  \*(C` and \*(C' expand to `' in nroff,
23 .\" nothing in troff, for use with C<>.
24 .tr \(*W-
25 .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
26 .ie n \{\
27 .    ds -- \(*W-
28 .    ds PI pi
29 .    if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
30 .    if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\"  diablo 12 pitch
31 .    ds L" ""
32 .    ds R" ""
33 .    ds C` ""
34 .    ds C' ""
35 'br\}
36 .el\{\
37 .    ds -- \|\(em\|
38 .    ds PI \(*p
39 .    ds L" ``
40 .    ds R" ''
41 .    ds C`
42 .    ds C'
43 'br\}
44 .\"
45 .\" Escape single quotes in literal strings from groff's Unicode transform.
46 .ie \n(.g .ds Aq \(aq
47 .el       .ds Aq '
48 .\"
49 .\" If the F register is >0, we'll generate index entries on stderr for
50 .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
51 .\" entries marked with X<> in POD.  Of course, you'll have to process the
52 .\" output yourself in some meaningful fashion.
53 .\"
54 .\" Avoid warning from groff about undefined register 'F'.
55 .de IX
56 ..
57 .nr rF 0
58 .if \n(.g .if rF .nr rF 1
59 .if (\n(rF:(\n(.g==0)) \{\
60 .    if \nF \{\
61 .        de IX
62 .        tm Index:\\$1\t\\n%\t"\\$2"
63 ..
64 .        if !\nF==2 \{\
65 .            nr % 0
66 .            nr F 2
67 .        \}
68 .    \}
69 .\}
70 .rr rF
71 .\"
72 .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
73 .\" Fear.  Run.  Save yourself.  No user-serviceable parts.
74 .    \" fudge factors for nroff and troff
75 .if n \{\
76 .    ds #H 0
77 .    ds #V .8m
78 .    ds #F .3m
79 .    ds #[ \f1
80 .    ds #] \fP
81 .\}
82 .if t \{\
83 .    ds #H ((1u-(\\\\n(.fu%2u))*.13m)
84 .    ds #V .6m
85 .    ds #F 0
86 .    ds #[ \&
87 .    ds #] \&
88 .\}
89 .    \" simple accents for nroff and troff
90 .if n \{\
91 .    ds ' \&
92 .    ds ` \&
93 .    ds ^ \&
94 .    ds , \&
95 .    ds ~ ~
96 .    ds /
97 .\}
98 .if t \{\
99 .    ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
100 .    ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
101 .    ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
102 .    ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
103 .    ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
104 .    ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
105 .\}
106 .    \" troff and (daisy-wheel) nroff accents
107 .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
108 .ds 8 \h'\*(#H'\(*b\h'-\*(#H'
109 .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
110 .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
111 .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
112 .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
113 .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
114 .ds ae a\h'-(\w'a'u*4/10)'e
115 .ds Ae A\h'-(\w'A'u*4/10)'E
116 .    \" corrections for vroff
117 .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
118 .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
119 .    \" for low resolution devices (crt and lpr)
120 .if \n(.H>23 .if \n(.V>19 \
121 \{\
122 .    ds : e
123 .    ds 8 ss
124 .    ds o a
125 .    ds d- d\h'-1'\(ga
126 .    ds D- D\h'-1'\(hy
127 .    ds th \o'bp'
128 .    ds Th \o'LP'
129 .    ds ae ae
130 .    ds Ae AE
131 .\}
132 .rm #[ #] #H #V #F C
133 .\" ========================================================================
134 .\"
135 .IX Title "VERIFY 1"
136 .TH VERIFY 1 "2020-03-17" "1.1.1e" "OpenSSL"
137 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
138 .\" way too many mistakes in technical documents.
139 .if n .ad l
140 .nh
141 .SH "NAME"
142 openssl\-verify, verify \- Utility to verify certificates
143 .SH "SYNOPSIS"
144 .IX Header "SYNOPSIS"
145 \&\fBopenssl\fR \fBverify\fR
146 [\fB\-help\fR]
147 [\fB\-CAfile file\fR]
148 [\fB\-CApath directory\fR]
149 [\fB\-no\-CAfile\fR]
150 [\fB\-no\-CApath\fR]
151 [\fB\-allow_proxy_certs\fR]
152 [\fB\-attime timestamp\fR]
153 [\fB\-check_ss_sig\fR]
154 [\fB\-CRLfile file\fR]
155 [\fB\-crl_download\fR]
156 [\fB\-crl_check\fR]
157 [\fB\-crl_check_all\fR]
158 [\fB\-engine id\fR]
159 [\fB\-explicit_policy\fR]
160 [\fB\-extended_crl\fR]
161 [\fB\-ignore_critical\fR]
162 [\fB\-inhibit_any\fR]
163 [\fB\-inhibit_map\fR]
164 [\fB\-nameopt option\fR]
165 [\fB\-no_check_time\fR]
166 [\fB\-partial_chain\fR]
167 [\fB\-policy arg\fR]
168 [\fB\-policy_check\fR]
169 [\fB\-policy_print\fR]
170 [\fB\-purpose purpose\fR]
171 [\fB\-suiteB_128\fR]
172 [\fB\-suiteB_128_only\fR]
173 [\fB\-suiteB_192\fR]
174 [\fB\-trusted_first\fR]
175 [\fB\-no_alt_chains\fR]
176 [\fB\-untrusted file\fR]
177 [\fB\-trusted file\fR]
178 [\fB\-use_deltas\fR]
179 [\fB\-verbose\fR]
180 [\fB\-auth_level level\fR]
181 [\fB\-verify_depth num\fR]
182 [\fB\-verify_email email\fR]
183 [\fB\-verify_hostname hostname\fR]
184 [\fB\-verify_ip ip\fR]
185 [\fB\-verify_name name\fR]
186 [\fB\-x509_strict\fR]
187 [\fB\-show_chain\fR]
188 [\fB\-\fR]
189 [certificates]
190 .SH "DESCRIPTION"
191 .IX Header "DESCRIPTION"
192 The \fBverify\fR command verifies certificate chains.
193 .SH "OPTIONS"
194 .IX Header "OPTIONS"
195 .IP "\fB\-help\fR" 4
196 .IX Item "-help"
197 Print out a usage message.
198 .IP "\fB\-CAfile file\fR" 4
199 .IX Item "-CAfile file"
200 A \fBfile\fR of trusted certificates.
201 The file should contain one or more certificates in \s-1PEM\s0 format.
202 .IP "\fB\-CApath directory\fR" 4
203 .IX Item "-CApath directory"
204 A directory of trusted certificates. The certificates should have names
205 of the form: hash.0 or have symbolic links to them of this
206 form (\*(L"hash\*(R" is the hashed certificate subject name: see the \fB\-hash\fR option
207 of the \fBx509\fR utility). Under Unix the \fBc_rehash\fR script will automatically
208 create symbolic links to a directory of certificates.
209 .IP "\fB\-no\-CAfile\fR" 4
210 .IX Item "-no-CAfile"
211 Do not load the trusted \s-1CA\s0 certificates from the default file location.
212 .IP "\fB\-no\-CApath\fR" 4
213 .IX Item "-no-CApath"
214 Do not load the trusted \s-1CA\s0 certificates from the default directory location.
215 .IP "\fB\-allow_proxy_certs\fR" 4
216 .IX Item "-allow_proxy_certs"
217 Allow the verification of proxy certificates.
218 .IP "\fB\-attime timestamp\fR" 4
219 .IX Item "-attime timestamp"
220 Perform validation checks using time specified by \fBtimestamp\fR and not
221 current system time. \fBtimestamp\fR is the number of seconds since
222 01.01.1970 (\s-1UNIX\s0 time).
223 .IP "\fB\-check_ss_sig\fR" 4
224 .IX Item "-check_ss_sig"
225 Verify the signature on the self-signed root \s-1CA.\s0 This is disabled by default
226 because it doesn't add any security.
227 .IP "\fB\-CRLfile file\fR" 4
228 .IX Item "-CRLfile file"
229 The \fBfile\fR should contain one or more CRLs in \s-1PEM\s0 format.
230 This option can be specified more than once to include CRLs from multiple
231 \&\fBfiles\fR.
232 .IP "\fB\-crl_download\fR" 4
233 .IX Item "-crl_download"
234 Attempt to download \s-1CRL\s0 information for this certificate.
235 .IP "\fB\-crl_check\fR" 4
236 .IX Item "-crl_check"
237 Checks end entity certificate validity by attempting to look up a valid \s-1CRL.\s0
238 If a valid \s-1CRL\s0 cannot be found an error occurs.
239 .IP "\fB\-crl_check_all\fR" 4
240 .IX Item "-crl_check_all"
241 Checks the validity of \fBall\fR certificates in the chain by attempting
242 to look up valid CRLs.
243 .IP "\fB\-engine id\fR" 4
244 .IX Item "-engine id"
245 Specifying an engine \fBid\fR will cause \fBverify\fR\|(1) to attempt to load the
246 specified engine.
247 The engine will then be set as the default for all its supported algorithms.
248 If you want to load certificates or CRLs that require engine support via any of
249 the \fB\-trusted\fR, \fB\-untrusted\fR or \fB\-CRLfile\fR options, the \fB\-engine\fR option
250 must be specified before those options.
251 .IP "\fB\-explicit_policy\fR" 4
252 .IX Item "-explicit_policy"
253 Set policy variable require-explicit-policy (see \s-1RFC5280\s0).
254 .IP "\fB\-extended_crl\fR" 4
255 .IX Item "-extended_crl"
256 Enable extended \s-1CRL\s0 features such as indirect CRLs and alternate \s-1CRL\s0
257 signing keys.
258 .IP "\fB\-ignore_critical\fR" 4
259 .IX Item "-ignore_critical"
260 Normally if an unhandled critical extension is present which is not
261 supported by OpenSSL the certificate is rejected (as required by \s-1RFC5280\s0).
262 If this option is set critical extensions are ignored.
263 .IP "\fB\-inhibit_any\fR" 4
264 .IX Item "-inhibit_any"
265 Set policy variable inhibit-any-policy (see \s-1RFC5280\s0).
266 .IP "\fB\-inhibit_map\fR" 4
267 .IX Item "-inhibit_map"
268 Set policy variable inhibit-policy-mapping (see \s-1RFC5280\s0).
269 .IP "\fB\-nameopt option\fR" 4
270 .IX Item "-nameopt option"
271 Option which determines how the subject or issuer names are displayed. The
272 \&\fBoption\fR argument can be a single option or multiple options separated by
273 commas.  Alternatively the \fB\-nameopt\fR switch may be used more than once to
274 set multiple options. See the \fBx509\fR\|(1) manual page for details.
275 .IP "\fB\-no_check_time\fR" 4
276 .IX Item "-no_check_time"
277 This option suppresses checking the validity period of certificates and CRLs
278 against the current time. If option \fB\-attime timestamp\fR is used to specify
279 a verification time, the check is not suppressed.
280 .IP "\fB\-partial_chain\fR" 4
281 .IX Item "-partial_chain"
282 Allow verification to succeed even if a \fIcomplete\fR chain cannot be built to a
283 self-signed trust-anchor, provided it is possible to construct a chain to a
284 trusted certificate that might not be self-signed.
285 .IP "\fB\-policy arg\fR" 4
286 .IX Item "-policy arg"
287 Enable policy processing and add \fBarg\fR to the user-initial-policy-set (see
288 \&\s-1RFC5280\s0). The policy \fBarg\fR can be an object name an \s-1OID\s0 in numeric form.
289 This argument can appear more than once.
290 .IP "\fB\-policy_check\fR" 4
291 .IX Item "-policy_check"
292 Enables certificate policy processing.
293 .IP "\fB\-policy_print\fR" 4
294 .IX Item "-policy_print"
295 Print out diagnostics related to policy processing.
296 .IP "\fB\-purpose purpose\fR" 4
297 .IX Item "-purpose purpose"
298 The intended use for the certificate. If this option is not specified,
299 \&\fBverify\fR will not consider certificate purpose during chain verification.
300 Currently accepted uses are \fBsslclient\fR, \fBsslserver\fR, \fBnssslserver\fR,
301 \&\fBsmimesign\fR, \fBsmimeencrypt\fR. See the \fB\s-1VERIFY OPERATION\s0\fR section for more
302 information.
303 .IP "\fB\-suiteB_128_only\fR, \fB\-suiteB_128\fR, \fB\-suiteB_192\fR" 4
304 .IX Item "-suiteB_128_only, -suiteB_128, -suiteB_192"
305 Enable the Suite B mode operation at 128 bit Level of Security, 128 bit or
306 192 bit, or only 192 bit Level of Security respectively.
307 See \s-1RFC6460\s0 for details. In particular the supported signature algorithms are
308 reduced to support only \s-1ECDSA\s0 and \s-1SHA256\s0 or \s-1SHA384\s0 and only the elliptic curves
309 P\-256 and P\-384.
310 .IP "\fB\-trusted_first\fR" 4
311 .IX Item "-trusted_first"
312 When constructing the certificate chain, use the trusted certificates specified
313 via \fB\-CAfile\fR, \fB\-CApath\fR or \fB\-trusted\fR before any certificates specified via
314 \&\fB\-untrusted\fR.
315 This can be useful in environments with Bridge or Cross-Certified CAs.
316 As of OpenSSL 1.1.0 this option is on by default and cannot be disabled.
317 .IP "\fB\-no_alt_chains\fR" 4
318 .IX Item "-no_alt_chains"
319 By default, unless \fB\-trusted_first\fR is specified, when building a certificate
320 chain, if the first certificate chain found is not trusted, then OpenSSL will
321 attempt to replace untrusted issuer certificates with certificates from the
322 trust store to see if an alternative chain can be found that is trusted.
323 As of OpenSSL 1.1.0, with \fB\-trusted_first\fR always on, this option has no
324 effect.
325 .IP "\fB\-untrusted file\fR" 4
326 .IX Item "-untrusted file"
327 A \fBfile\fR of additional untrusted certificates (intermediate issuer CAs) used
328 to construct a certificate chain from the subject certificate to a trust-anchor.
329 The \fBfile\fR should contain one or more certificates in \s-1PEM\s0 format.
330 This option can be specified more than once to include untrusted certificates
331 from multiple \fBfiles\fR.
332 .IP "\fB\-trusted file\fR" 4
333 .IX Item "-trusted file"
334 A \fBfile\fR of trusted certificates, which must be self-signed, unless the
335 \&\fB\-partial_chain\fR option is specified.
336 The \fBfile\fR contains one or more certificates in \s-1PEM\s0 format.
337 With this option, no additional (e.g., default) certificate lists are
338 consulted.
339 That is, the only trust-anchors are those listed in \fBfile\fR.
340 This option can be specified more than once to include trusted certificates
341 from multiple \fBfiles\fR.
342 This option implies the \fB\-no\-CAfile\fR and \fB\-no\-CApath\fR options.
343 This option cannot be used in combination with either of the \fB\-CAfile\fR or
344 \&\fB\-CApath\fR options.
345 .IP "\fB\-use_deltas\fR" 4
346 .IX Item "-use_deltas"
347 Enable support for delta CRLs.
348 .IP "\fB\-verbose\fR" 4
349 .IX Item "-verbose"
350 Print extra information about the operations being performed.
351 .IP "\fB\-auth_level level\fR" 4
352 .IX Item "-auth_level level"
353 Set the certificate chain authentication security level to \fBlevel\fR.
354 The authentication security level determines the acceptable signature and
355 public key strength when verifying certificate chains.
356 For a certificate chain to validate, the public keys of all the certificates
357 must meet the specified security \fBlevel\fR.
358 The signature algorithm security level is enforced for all the certificates in
359 the chain except for the chain's \fItrust anchor\fR, which is either directly
360 trusted or validated by means other than its signature.
361 See \fBSSL_CTX_set_security_level\fR\|(3) for the definitions of the available
362 levels.
363 The default security level is \-1, or \*(L"not set\*(R".
364 At security level 0 or lower all algorithms are acceptable.
365 Security level 1 requires at least 80\-bit\-equivalent security and is broadly
366 interoperable, though it will, for example, reject \s-1MD5\s0 signatures or \s-1RSA\s0 keys
367 shorter than 1024 bits.
368 .IP "\fB\-verify_depth num\fR" 4
369 .IX Item "-verify_depth num"
370 Limit the certificate chain to \fBnum\fR intermediate \s-1CA\s0 certificates.
371 A maximal depth chain can have up to \fBnum+2\fR certificates, since neither the
372 end-entity certificate nor the trust-anchor certificate count against the
373 \&\fB\-verify_depth\fR limit.
374 .IP "\fB\-verify_email email\fR" 4
375 .IX Item "-verify_email email"
376 Verify if the \fBemail\fR matches the email address in Subject Alternative Name or
377 the email in the subject Distinguished Name.
378 .IP "\fB\-verify_hostname hostname\fR" 4
379 .IX Item "-verify_hostname hostname"
380 Verify if the \fBhostname\fR matches \s-1DNS\s0 name in Subject Alternative Name or
381 Common Name in the subject certificate.
382 .IP "\fB\-verify_ip ip\fR" 4
383 .IX Item "-verify_ip ip"
384 Verify if the \fBip\fR matches the \s-1IP\s0 address in Subject Alternative Name of
385 the subject certificate.
386 .IP "\fB\-verify_name name\fR" 4
387 .IX Item "-verify_name name"
388 Use default verification policies like trust model and required certificate
389 policies identified by \fBname\fR.
390 The trust model determines which auxiliary trust or reject OIDs are applicable
391 to verifying the given certificate chain.
392 See the \fB\-addtrust\fR and \fB\-addreject\fR options of the \fBx509\fR\|(1) command-line
393 utility.
394 Supported policy names include: \fBdefault\fR, \fBpkcs7\fR, \fBsmime_sign\fR,
395 \&\fBssl_client\fR, \fBssl_server\fR.
396 These mimics the combinations of purpose and trust settings used in \s-1SSL, CMS\s0
397 and S/MIME.
398 As of OpenSSL 1.1.0, the trust model is inferred from the purpose when not
399 specified, so the \fB\-verify_name\fR options are functionally equivalent to the
400 corresponding \fB\-purpose\fR settings.
401 .IP "\fB\-x509_strict\fR" 4
402 .IX Item "-x509_strict"
403 For strict X.509 compliance, disable non-compliant workarounds for broken
404 certificates.
405 .IP "\fB\-show_chain\fR" 4
406 .IX Item "-show_chain"
407 Display information about the certificate chain that has been built (if
408 successful). Certificates in the chain that came from the untrusted list will be
409 flagged as \*(L"untrusted\*(R".
410 .IP "\fB\-\fR" 4
411 .IX Item "-"
412 Indicates the last option. All arguments following this are assumed to be
413 certificate files. This is useful if the first certificate filename begins
414 with a \fB\-\fR.
415 .IP "\fBcertificates\fR" 4
416 .IX Item "certificates"
417 One or more certificates to verify. If no certificates are given, \fBverify\fR
418 will attempt to read a certificate from standard input. Certificates must be
419 in \s-1PEM\s0 format.
420 .SH "VERIFY OPERATION"
421 .IX Header "VERIFY OPERATION"
422 The \fBverify\fR program uses the same functions as the internal \s-1SSL\s0 and S/MIME
423 verification, therefore this description applies to these verify operations
424 too.
425 .PP
426 There is one crucial difference between the verify operations performed
427 by the \fBverify\fR program: wherever possible an attempt is made to continue
428 after an error whereas normally the verify operation would halt on the
429 first error. This allows all the problems with a certificate chain to be
430 determined.
431 .PP
432 The verify operation consists of a number of separate steps.
433 .PP
434 Firstly a certificate chain is built up starting from the supplied certificate
435 and ending in the root \s-1CA.\s0
436 It is an error if the whole chain cannot be built up.
437 The chain is built up by looking up the issuers certificate of the current
438 certificate.
439 If a certificate is found which is its own issuer it is assumed to be the root
440 \&\s-1CA.\s0
441 .PP
442 The process of 'looking up the issuers certificate' itself involves a number of
443 steps.
444 After all certificates whose subject name matches the issuer name of the current
445 certificate are subject to further tests.
446 The relevant authority key identifier components of the current certificate (if
447 present) must match the subject key identifier (if present) and issuer and
448 serial number of the candidate issuer, in addition the keyUsage extension of
449 the candidate issuer (if present) must permit certificate signing.
450 .PP
451 The lookup first looks in the list of untrusted certificates and if no match
452 is found the remaining lookups are from the trusted certificates. The root \s-1CA\s0
453 is always looked up in the trusted certificate list: if the certificate to
454 verify is a root certificate then an exact match must be found in the trusted
455 list.
456 .PP
457 The second operation is to check every untrusted certificate's extensions for
458 consistency with the supplied purpose. If the \fB\-purpose\fR option is not included
459 then no checks are done. The supplied or \*(L"leaf\*(R" certificate must have extensions
460 compatible with the supplied purpose and all other certificates must also be valid
461 \&\s-1CA\s0 certificates. The precise extensions required are described in more detail in
462 the \fB\s-1CERTIFICATE EXTENSIONS\s0\fR section of the \fBx509\fR utility.
463 .PP
464 The third operation is to check the trust settings on the root \s-1CA.\s0 The root \s-1CA\s0
465 should be trusted for the supplied purpose.
466 For compatibility with previous versions of OpenSSL, a certificate with no
467 trust settings is considered to be valid for all purposes.
468 .PP
469 The final operation is to check the validity of the certificate chain. The validity
470 period is checked against the current system time and the notBefore and notAfter
471 dates in the certificate. The certificate signatures are also checked at this
472 point.
473 .PP
474 If all operations complete successfully then certificate is considered valid. If
475 any operation fails then the certificate is not valid.
476 .SH "DIAGNOSTICS"
477 .IX Header "DIAGNOSTICS"
478 When a verify operation fails the output messages can be somewhat cryptic. The
479 general form of the error message is:
480 .PP
481 .Vb 2
482 \& server.pem: /C=AU/ST=Queensland/O=CryptSoft Pty Ltd/CN=Test CA (1024 bit)
483 \& error 24 at 1 depth lookup:invalid CA certificate
484 .Ve
485 .PP
486 The first line contains the name of the certificate being verified followed by
487 the subject name of the certificate. The second line contains the error number
488 and the depth. The depth is number of the certificate being verified when a
489 problem was detected starting with zero for the certificate being verified itself
490 then 1 for the \s-1CA\s0 that signed the certificate and so on. Finally a text version
491 of the error number is presented.
492 .PP
493 A partial list of the error codes and messages is shown below, this also
494 includes the name of the error code as defined in the header file x509_vfy.h
495 Some of the error codes are defined but never returned: these are described
496 as \*(L"unused\*(R".
497 .IP "\fBX509_V_OK\fR" 4
498 .IX Item "X509_V_OK"
499 The operation was successful.
500 .IP "\fBX509_V_ERR_UNSPECIFIED\fR" 4
501 .IX Item "X509_V_ERR_UNSPECIFIED"
502 Unspecified error; should not happen.
503 .IP "\fBX509_V_ERR_UNABLE_TO_GET_ISSUER_CERT\fR" 4
504 .IX Item "X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT"
505 The issuer certificate of a looked up certificate could not be found. This
506 normally means the list of trusted certificates is not complete.
507 .IP "\fBX509_V_ERR_UNABLE_TO_GET_CRL\fR" 4
508 .IX Item "X509_V_ERR_UNABLE_TO_GET_CRL"
509 The \s-1CRL\s0 of a certificate could not be found.
510 .IP "\fBX509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE\fR" 4
511 .IX Item "X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE"
512 The certificate signature could not be decrypted. This means that the
513 actual signature value could not be determined rather than it not matching
514 the expected value, this is only meaningful for \s-1RSA\s0 keys.
515 .IP "\fBX509_V_ERR_UNABLE_TO_DECRYPT_CRL_SIGNATURE\fR" 4
516 .IX Item "X509_V_ERR_UNABLE_TO_DECRYPT_CRL_SIGNATURE"
517 The \s-1CRL\s0 signature could not be decrypted: this means that the actual
518 signature value could not be determined rather than it not matching the
519 expected value. Unused.
520 .IP "\fBX509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY\fR" 4
521 .IX Item "X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY"
522 The public key in the certificate SubjectPublicKeyInfo could not be read.
523 .IP "\fBX509_V_ERR_CERT_SIGNATURE_FAILURE\fR" 4
524 .IX Item "X509_V_ERR_CERT_SIGNATURE_FAILURE"
525 The signature of the certificate is invalid.
526 .IP "\fBX509_V_ERR_CRL_SIGNATURE_FAILURE\fR" 4
527 .IX Item "X509_V_ERR_CRL_SIGNATURE_FAILURE"
528 The signature of the certificate is invalid.
529 .IP "\fBX509_V_ERR_CERT_NOT_YET_VALID\fR" 4
530 .IX Item "X509_V_ERR_CERT_NOT_YET_VALID"
531 The certificate is not yet valid: the notBefore date is after the
532 current time.
533 .IP "\fBX509_V_ERR_CERT_HAS_EXPIRED\fR" 4
534 .IX Item "X509_V_ERR_CERT_HAS_EXPIRED"
535 The certificate has expired: that is the notAfter date is before the
536 current time.
537 .IP "\fBX509_V_ERR_CRL_NOT_YET_VALID\fR" 4
538 .IX Item "X509_V_ERR_CRL_NOT_YET_VALID"
539 The \s-1CRL\s0 is not yet valid.
540 .IP "\fBX509_V_ERR_CRL_HAS_EXPIRED\fR" 4
541 .IX Item "X509_V_ERR_CRL_HAS_EXPIRED"
542 The \s-1CRL\s0 has expired.
543 .IP "\fBX509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD\fR" 4
544 .IX Item "X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD"
545 The certificate notBefore field contains an invalid time.
546 .IP "\fBX509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD\fR" 4
547 .IX Item "X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD"
548 The certificate notAfter field contains an invalid time.
549 .IP "\fBX509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD\fR" 4
550 .IX Item "X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD"
551 The \s-1CRL\s0 lastUpdate field contains an invalid time.
552 .IP "\fBX509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD\fR" 4
553 .IX Item "X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD"
554 The \s-1CRL\s0 nextUpdate field contains an invalid time.
555 .IP "\fBX509_V_ERR_OUT_OF_MEM\fR" 4
556 .IX Item "X509_V_ERR_OUT_OF_MEM"
557 An error occurred trying to allocate memory. This should never happen.
558 .IP "\fBX509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT\fR" 4
559 .IX Item "X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT"
560 The passed certificate is self-signed and the same certificate cannot
561 be found in the list of trusted certificates.
562 .IP "\fBX509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN\fR" 4
563 .IX Item "X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN"
564 The certificate chain could be built up using the untrusted certificates
565 but the root could not be found locally.
566 .IP "\fBX509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY\fR" 4
567 .IX Item "X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY"
568 The issuer certificate could not be found: this occurs if the issuer
569 certificate of an untrusted certificate cannot be found.
570 .IP "\fBX509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE\fR" 4
571 .IX Item "X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE"
572 No signatures could be verified because the chain contains only one
573 certificate and it is not self signed.
574 .IP "\fBX509_V_ERR_CERT_CHAIN_TOO_LONG\fR" 4
575 .IX Item "X509_V_ERR_CERT_CHAIN_TOO_LONG"
576 The certificate chain length is greater than the supplied maximum
577 depth. Unused.
578 .IP "\fBX509_V_ERR_CERT_REVOKED\fR" 4
579 .IX Item "X509_V_ERR_CERT_REVOKED"
580 The certificate has been revoked.
581 .IP "\fBX509_V_ERR_INVALID_CA\fR" 4
582 .IX Item "X509_V_ERR_INVALID_CA"
583 A \s-1CA\s0 certificate is invalid. Either it is not a \s-1CA\s0 or its extensions
584 are not consistent with the supplied purpose.
585 .IP "\fBX509_V_ERR_PATH_LENGTH_EXCEEDED\fR" 4
586 .IX Item "X509_V_ERR_PATH_LENGTH_EXCEEDED"
587 The basicConstraints pathlength parameter has been exceeded.
588 .IP "\fBX509_V_ERR_INVALID_PURPOSE\fR" 4
589 .IX Item "X509_V_ERR_INVALID_PURPOSE"
590 The supplied certificate cannot be used for the specified purpose.
591 .IP "\fBX509_V_ERR_CERT_UNTRUSTED\fR" 4
592 .IX Item "X509_V_ERR_CERT_UNTRUSTED"
593 The root \s-1CA\s0 is not marked as trusted for the specified purpose.
594 .IP "\fBX509_V_ERR_CERT_REJECTED\fR" 4
595 .IX Item "X509_V_ERR_CERT_REJECTED"
596 The root \s-1CA\s0 is marked to reject the specified purpose.
597 .IP "\fBX509_V_ERR_SUBJECT_ISSUER_MISMATCH\fR" 4
598 .IX Item "X509_V_ERR_SUBJECT_ISSUER_MISMATCH"
599 Not used as of OpenSSL 1.1.0 as a result of the deprecation of the
600 \&\fB\-issuer_checks\fR option.
601 .IP "\fBX509_V_ERR_AKID_SKID_MISMATCH\fR" 4
602 .IX Item "X509_V_ERR_AKID_SKID_MISMATCH"
603 Not used as of OpenSSL 1.1.0 as a result of the deprecation of the
604 \&\fB\-issuer_checks\fR option.
605 .IP "\fBX509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH\fR" 4
606 .IX Item "X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH"
607 Not used as of OpenSSL 1.1.0 as a result of the deprecation of the
608 \&\fB\-issuer_checks\fR option.
609 .IP "\fBX509_V_ERR_KEYUSAGE_NO_CERTSIGN\fR" 4
610 .IX Item "X509_V_ERR_KEYUSAGE_NO_CERTSIGN"
611 Not used as of OpenSSL 1.1.0 as a result of the deprecation of the
612 \&\fB\-issuer_checks\fR option.
613 .IP "\fBX509_V_ERR_UNABLE_TO_GET_CRL_ISSUER\fR" 4
614 .IX Item "X509_V_ERR_UNABLE_TO_GET_CRL_ISSUER"
615 Unable to get \s-1CRL\s0 issuer certificate.
616 .IP "\fBX509_V_ERR_UNHANDLED_CRITICAL_EXTENSION\fR" 4
617 .IX Item "X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION"
618 Unhandled critical extension.
619 .IP "\fBX509_V_ERR_KEYUSAGE_NO_CRL_SIGN\fR" 4
620 .IX Item "X509_V_ERR_KEYUSAGE_NO_CRL_SIGN"
621 Key usage does not include \s-1CRL\s0 signing.
622 .IP "\fBX509_V_ERR_UNHANDLED_CRITICAL_CRL_EXTENSION\fR" 4
623 .IX Item "X509_V_ERR_UNHANDLED_CRITICAL_CRL_EXTENSION"
624 Unhandled critical \s-1CRL\s0 extension.
625 .IP "\fBX509_V_ERR_INVALID_NON_CA\fR" 4
626 .IX Item "X509_V_ERR_INVALID_NON_CA"
627 Invalid non-CA certificate has \s-1CA\s0 markings.
628 .IP "\fBX509_V_ERR_PROXY_PATH_LENGTH_EXCEEDED\fR" 4
629 .IX Item "X509_V_ERR_PROXY_PATH_LENGTH_EXCEEDED"
630 Proxy path length constraint exceeded.
631 .IP "\fBX509_V_ERR_PROXY_SUBJECT_INVALID\fR" 4
632 .IX Item "X509_V_ERR_PROXY_SUBJECT_INVALID"
633 Proxy certificate subject is invalid.  It \s-1MUST\s0 be the same as the issuer
634 with a single \s-1CN\s0 component added.
635 .IP "\fBX509_V_ERR_KEYUSAGE_NO_DIGITAL_SIGNATURE\fR" 4
636 .IX Item "X509_V_ERR_KEYUSAGE_NO_DIGITAL_SIGNATURE"
637 Key usage does not include digital signature.
638 .IP "\fBX509_V_ERR_PROXY_CERTIFICATES_NOT_ALLOWED\fR" 4
639 .IX Item "X509_V_ERR_PROXY_CERTIFICATES_NOT_ALLOWED"
640 Proxy certificates not allowed, please use \fB\-allow_proxy_certs\fR.
641 .IP "\fBX509_V_ERR_INVALID_EXTENSION\fR" 4
642 .IX Item "X509_V_ERR_INVALID_EXTENSION"
643 Invalid or inconsistent certificate extension.
644 .IP "\fBX509_V_ERR_INVALID_POLICY_EXTENSION\fR" 4
645 .IX Item "X509_V_ERR_INVALID_POLICY_EXTENSION"
646 Invalid or inconsistent certificate policy extension.
647 .IP "\fBX509_V_ERR_NO_EXPLICIT_POLICY\fR" 4
648 .IX Item "X509_V_ERR_NO_EXPLICIT_POLICY"
649 No explicit policy.
650 .IP "\fBX509_V_ERR_DIFFERENT_CRL_SCOPE\fR" 4
651 .IX Item "X509_V_ERR_DIFFERENT_CRL_SCOPE"
652 Different \s-1CRL\s0 scope.
653 .IP "\fBX509_V_ERR_UNSUPPORTED_EXTENSION_FEATURE\fR" 4
654 .IX Item "X509_V_ERR_UNSUPPORTED_EXTENSION_FEATURE"
655 Unsupported extension feature.
656 .IP "\fBX509_V_ERR_UNNESTED_RESOURCE\fR" 4
657 .IX Item "X509_V_ERR_UNNESTED_RESOURCE"
658 \&\s-1RFC 3779\s0 resource not subset of parent's resources.
659 .IP "\fBX509_V_ERR_PERMITTED_VIOLATION\fR" 4
660 .IX Item "X509_V_ERR_PERMITTED_VIOLATION"
661 Permitted subtree violation.
662 .IP "\fBX509_V_ERR_EXCLUDED_VIOLATION\fR" 4
663 .IX Item "X509_V_ERR_EXCLUDED_VIOLATION"
664 Excluded subtree violation.
665 .IP "\fBX509_V_ERR_SUBTREE_MINMAX\fR" 4
666 .IX Item "X509_V_ERR_SUBTREE_MINMAX"
667 Name constraints minimum and maximum not supported.
668 .IP "\fBX509_V_ERR_APPLICATION_VERIFICATION\fR" 4
669 .IX Item "X509_V_ERR_APPLICATION_VERIFICATION"
670 Application verification failure. Unused.
671 .IP "\fBX509_V_ERR_UNSUPPORTED_CONSTRAINT_TYPE\fR" 4
672 .IX Item "X509_V_ERR_UNSUPPORTED_CONSTRAINT_TYPE"
673 Unsupported name constraint type.
674 .IP "\fBX509_V_ERR_UNSUPPORTED_CONSTRAINT_SYNTAX\fR" 4
675 .IX Item "X509_V_ERR_UNSUPPORTED_CONSTRAINT_SYNTAX"
676 Unsupported or invalid name constraint syntax.
677 .IP "\fBX509_V_ERR_UNSUPPORTED_NAME_SYNTAX\fR" 4
678 .IX Item "X509_V_ERR_UNSUPPORTED_NAME_SYNTAX"
679 Unsupported or invalid name syntax.
680 .IP "\fBX509_V_ERR_CRL_PATH_VALIDATION_ERROR\fR" 4
681 .IX Item "X509_V_ERR_CRL_PATH_VALIDATION_ERROR"
682 \&\s-1CRL\s0 path validation error.
683 .IP "\fBX509_V_ERR_PATH_LOOP\fR" 4
684 .IX Item "X509_V_ERR_PATH_LOOP"
685 Path loop.
686 .IP "\fBX509_V_ERR_SUITE_B_INVALID_VERSION\fR" 4
687 .IX Item "X509_V_ERR_SUITE_B_INVALID_VERSION"
688 Suite B: certificate version invalid.
689 .IP "\fBX509_V_ERR_SUITE_B_INVALID_ALGORITHM\fR" 4
690 .IX Item "X509_V_ERR_SUITE_B_INVALID_ALGORITHM"
691 Suite B: invalid public key algorithm.
692 .IP "\fBX509_V_ERR_SUITE_B_INVALID_CURVE\fR" 4
693 .IX Item "X509_V_ERR_SUITE_B_INVALID_CURVE"
694 Suite B: invalid \s-1ECC\s0 curve.
695 .IP "\fBX509_V_ERR_SUITE_B_INVALID_SIGNATURE_ALGORITHM\fR" 4
696 .IX Item "X509_V_ERR_SUITE_B_INVALID_SIGNATURE_ALGORITHM"
697 Suite B: invalid signature algorithm.
698 .IP "\fBX509_V_ERR_SUITE_B_LOS_NOT_ALLOWED\fR" 4
699 .IX Item "X509_V_ERR_SUITE_B_LOS_NOT_ALLOWED"
700 Suite B: curve not allowed for this \s-1LOS.\s0
701 .IP "\fBX509_V_ERR_SUITE_B_CANNOT_SIGN_P_384_WITH_P_256\fR" 4
702 .IX Item "X509_V_ERR_SUITE_B_CANNOT_SIGN_P_384_WITH_P_256"
703 Suite B: cannot sign P\-384 with P\-256.
704 .IP "\fBX509_V_ERR_HOSTNAME_MISMATCH\fR" 4
705 .IX Item "X509_V_ERR_HOSTNAME_MISMATCH"
706 Hostname mismatch.
707 .IP "\fBX509_V_ERR_EMAIL_MISMATCH\fR" 4
708 .IX Item "X509_V_ERR_EMAIL_MISMATCH"
709 Email address mismatch.
710 .IP "\fBX509_V_ERR_IP_ADDRESS_MISMATCH\fR" 4
711 .IX Item "X509_V_ERR_IP_ADDRESS_MISMATCH"
712 \&\s-1IP\s0 address mismatch.
713 .IP "\fBX509_V_ERR_DANE_NO_MATCH\fR" 4
714 .IX Item "X509_V_ERR_DANE_NO_MATCH"
715 \&\s-1DANE TLSA\s0 authentication is enabled, but no \s-1TLSA\s0 records matched the
716 certificate chain.
717 This error is only possible in \fBs_client\fR\|(1).
718 .IP "\fBX509_V_ERR_EE_KEY_TOO_SMALL\fR" 4
719 .IX Item "X509_V_ERR_EE_KEY_TOO_SMALL"
720 \&\s-1EE\s0 certificate key too weak.
721 .IP "\fBX509_ERR_CA_KEY_TOO_SMALL\fR" 4
722 .IX Item "X509_ERR_CA_KEY_TOO_SMALL"
723 \&\s-1CA\s0 certificate key too weak.
724 .IP "\fBX509_ERR_CA_MD_TOO_WEAK\fR" 4
725 .IX Item "X509_ERR_CA_MD_TOO_WEAK"
726 \&\s-1CA\s0 signature digest algorithm too weak.
727 .IP "\fBX509_V_ERR_INVALID_CALL\fR" 4
728 .IX Item "X509_V_ERR_INVALID_CALL"
729 nvalid certificate verification context.
730 .IP "\fBX509_V_ERR_STORE_LOOKUP\fR" 4
731 .IX Item "X509_V_ERR_STORE_LOOKUP"
732 Issuer certificate lookup error.
733 .IP "\fBX509_V_ERR_NO_VALID_SCTS\fR" 4
734 .IX Item "X509_V_ERR_NO_VALID_SCTS"
735 Certificate Transparency required, but no valid SCTs found.
736 .IP "\fBX509_V_ERR_PROXY_SUBJECT_NAME_VIOLATION\fR" 4
737 .IX Item "X509_V_ERR_PROXY_SUBJECT_NAME_VIOLATION"
738 Proxy subject name violation.
739 .IP "\fBX509_V_ERR_OCSP_VERIFY_NEEDED\fR" 4
740 .IX Item "X509_V_ERR_OCSP_VERIFY_NEEDED"
741 Returned by the verify callback to indicate an \s-1OCSP\s0 verification is needed.
742 .IP "\fBX509_V_ERR_OCSP_VERIFY_FAILED\fR" 4
743 .IX Item "X509_V_ERR_OCSP_VERIFY_FAILED"
744 Returned by the verify callback to indicate \s-1OCSP\s0 verification failed.
745 .IP "\fBX509_V_ERR_OCSP_CERT_UNKNOWN\fR" 4
746 .IX Item "X509_V_ERR_OCSP_CERT_UNKNOWN"
747 Returned by the verify callback to indicate that the certificate is not recognized
748 by the \s-1OCSP\s0 responder.
749 .SH "BUGS"
750 .IX Header "BUGS"
751 Although the issuer checks are a considerable improvement over the old
752 technique they still suffer from limitations in the underlying X509_LOOKUP
753 \&\s-1API.\s0 One consequence of this is that trusted certificates with matching
754 subject name must either appear in a file (as specified by the \fB\-CAfile\fR
755 option) or a directory (as specified by \fB\-CApath\fR). If they occur in
756 both then only the certificates in the file will be recognised.
757 .PP
758 Previous versions of OpenSSL assume certificates with matching subject
759 name are identical and mishandled them.
760 .PP
761 Previous versions of this documentation swapped the meaning of the
762 \&\fBX509_V_ERR_UNABLE_TO_GET_ISSUER_CERT\fR and
763 \&\fBX509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY\fR error codes.
764 .SH "SEE ALSO"
765 .IX Header "SEE ALSO"
766 \&\fBx509\fR\|(1)
767 .SH "HISTORY"
768 .IX Header "HISTORY"
769 The \fB\-show_chain\fR option was added in OpenSSL 1.1.0.
770 .PP
771 The \fB\-issuer_checks\fR option is deprecated as of OpenSSL 1.1.0 and
772 is silently ignored.
773 .SH "COPYRIGHT"
774 .IX Header "COPYRIGHT"
775 Copyright 2000\-2017 The OpenSSL Project Authors. All Rights Reserved.
776 .PP
777 Licensed under the OpenSSL license (the \*(L"License\*(R").  You may not use
778 this file except in compliance with the License.  You can obtain a copy
779 in the file \s-1LICENSE\s0 in the source distribution or at
780 <https://www.openssl.org/source/license.html>.