1OCSP(1)                             OpenSSL                            OCSP(1)
2
3
4

NAME

6       ocsp - Online Certificate Status Protocol utility
7

SYNOPSIS

9       openssl ocsp [-out file] [-issuer file] [-cert file] [-serial n]
10       [-signer file] [-signkey file] [-sign_other file] [-no_certs]
11       [-req_text] [-resp_text] [-text] [-reqout file] [-respout file] [-reqin
12       file] [-respin file] [-nonce] [-no_nonce] [-url URL] [-host host:n]
13       [-header name value] [-path] [-CApath dir] [-CAfile file]
14       [-trusted_first] [-no_alt_chains] [-VAfile file] [-validity_period n]
15       [-status_age n] [-noverify] [-verify_other file] [-trust_other]
16       [-no_intern] [-no_signature_verify] [-no_cert_verify] [-no_chain]
17       [-no_cert_checks] [-no_explicit] [-port num] [-index file] [-CA file]
18       [-rsigner file] [-rkey file] [-rother file] [-resp_no_certs] [-nmin n]
19       [-ndays n] [-resp_key_id] [-nrequest n] [-md5|-sha1|...]
20

DESCRIPTION

22       The Online Certificate Status Protocol (OCSP) enables applications to
23       determine the (revocation) state of an identified certificate (RFC
24       2560).
25
26       The ocsp command performs many common OCSP tasks. It can be used to
27       print out requests and responses, create requests and send queries to
28       an OCSP responder and behave like a mini OCSP server itself.
29

OCSP CLIENT OPTIONS

31       -out filename
32           specify output filename, default is standard output.
33
34       -issuer filename
35           This specifies the current issuer certificate. This option can be
36           used multiple times. The certificate specified in filename must be
37           in PEM format. This option MUST come before any -cert options.
38
39       -cert filename
40           Add the certificate filename to the request. The issuer certificate
41           is taken from the previous issuer option, or an error occurs if no
42           issuer certificate is specified.
43
44       -serial num
45           Same as the cert option except the certificate with serial number
46           num is added to the request. The serial number is interpreted as a
47           decimal integer unless preceded by 0x. Negative integers can also
48           be specified by preceding the value by a - sign.
49
50       -signer filename, -signkey filename
51           Sign the OCSP request using the certificate specified in the signer
52           option and the private key specified by the signkey option. If the
53           signkey option is not present then the private key is read from the
54           same file as the certificate. If neither option is specified then
55           the OCSP request is not signed.
56
57       -sign_other filename
58           Additional certificates to include in the signed request.
59
60       -nonce, -no_nonce
61           Add an OCSP nonce extension to a request or disable OCSP nonce
62           addition.  Normally if an OCSP request is input using the respin
63           option no nonce is added: using the nonce option will force
64           addition of a nonce.  If an OCSP request is being created (using
65           cert and serial options) a nonce is automatically added specifying
66           no_nonce overrides this.
67
68       -req_text, -resp_text, -text
69           print out the text form of the OCSP request, response or both
70           respectively.
71
72       -reqout file, -respout file
73           write out the DER encoded certificate request or response to file.
74
75       -reqin file, -respin file
76           read OCSP request or response file from file. These option are
77           ignored if OCSP request or response creation is implied by other
78           options (for example with serial, cert and host options).
79
80       -url responder_url
81           specify the responder URL. Both HTTP and HTTPS (SSL/TLS) URLs can
82           be specified.
83
84       -host hostname:port, -path pathname
85           if the host option is present then the OCSP request is sent to the
86           host hostname on port port. path specifies the HTTP path name to
87           use or "/" by default.
88
89       -header name value
90           If sending a request to an OCSP server, then the specified header
91           name and value are added to the HTTP request.  Note that the name
92           and value must be specified as two separate parameters, not as a
93           single quoted string, and that the header name does not have the
94           trailing colon.  Some OCSP responders require a Host header; use
95           this flag to provide it.
96
97       -timeout seconds
98           connection timeout to the OCSP responder in seconds
99
100       -CAfile file, -CApath pathname
101           file or pathname containing trusted CA certificates. These are used
102           to verify the signature on the OCSP response.
103
104       -trusted_first
105           Use certificates in CA file or CA directory over certificates
106           provided in the response or residing in other certificates file
107           when building the trust chain to verify responder certificate.
108           This is mainly useful in environments with Bridge CA or Cross-
109           Certified CAs.
110
111       -no_alt_chains
112           See verify manual page for details.
113
114       -verify_other file
115           file containing additional certificates to search when attempting
116           to locate the OCSP response signing certificate. Some responders
117           omit the actual signer's certificate from the response: this option
118           can be used to supply the necessary certificate in such cases.
119
120       -trust_other
121           the certificates specified by the -verify_other option should be
122           explicitly trusted and no additional checks will be performed on
123           them. This is useful when the complete responder certificate chain
124           is not available or trusting a root CA is not appropriate.
125
126       -VAfile file
127           file containing explicitly trusted responder certificates.
128           Equivalent to the -verify_other and -trust_other options.
129
130       -noverify
131           don't attempt to verify the OCSP response signature or the nonce
132           values. This option will normally only be used for debugging since
133           it disables all verification of the responders certificate.
134
135       -no_intern
136           ignore certificates contained in the OCSP response when searching
137           for the signers certificate. With this option the signers
138           certificate must be specified with either the -verify_other or
139           -VAfile options.
140
141       -no_signature_verify
142           don't check the signature on the OCSP response. Since this option
143           tolerates invalid signatures on OCSP responses it will normally
144           only be used for testing purposes.
145
146       -no_cert_verify
147           don't verify the OCSP response signers certificate at all. Since
148           this option allows the OCSP response to be signed by any
149           certificate it should only be used for testing purposes.
150
151       -no_chain
152           do not use certificates in the response as additional untrusted CA
153           certificates.
154
155       -no_explicit
156           do not explicitly trust the root CA if it is set to be trusted for
157           OCSP signing.
158
159       -no_cert_checks
160           don't perform any additional checks on the OCSP response signers
161           certificate.  That is do not make any checks to see if the signers
162           certificate is authorised to provide the necessary status
163           information: as a result this option should only be used for
164           testing purposes.
165
166       -validity_period nsec, -status_age age
167           these options specify the range of times, in seconds, which will be
168           tolerated in an OCSP response. Each certificate status response
169           includes a notBefore time and an optional notAfter time. The
170           current time should fall between these two values, but the interval
171           between the two times may be only a few seconds. In practice the
172           OCSP responder and clients clocks may not be precisely synchronised
173           and so such a check may fail. To avoid this the -validity_period
174           option can be used to specify an acceptable error range in seconds,
175           the default value is 5 minutes.
176
177           If the notAfter time is omitted from a response then this means
178           that new status information is immediately available. In this case
179           the age of the notBefore field is checked to see it is not older
180           than age seconds old. By default this additional check is not
181           performed.
182
183       -md5|-sha1|-sha256|-ripemod160|...
184           this option sets digest algorithm to use for certificate
185           identification in the OCSP request. By default SHA-1 is used. See
186           openssl dgst -h output for the list of available algorithms.
187

OCSP SERVER OPTIONS

189       -index indexfile
190           indexfile is a text index file in ca format containing certificate
191           revocation information.
192
193           If the index option is specified the ocsp utility is in responder
194           mode, otherwise it is in client mode. The request(s) the responder
195           processes can be either specified on the command line (using issuer
196           and serial options), supplied in a file (using the respin option)
197           or via external OCSP clients (if port or url is specified).
198
199           If the index option is present then the CA and rsigner options must
200           also be present.
201
202       -CA file
203           CA certificate corresponding to the revocation information in
204           indexfile.
205
206       -rsigner file
207           The certificate to sign OCSP responses with.
208
209       -rother file
210           Additional certificates to include in the OCSP response.
211
212       -resp_no_certs
213           Don't include any certificates in the OCSP response.
214
215       -resp_key_id
216           Identify the signer certificate using the key ID, default is to use
217           the subject name.
218
219       -rkey file
220           The private key to sign OCSP responses with: if not present the
221           file specified in the rsigner option is used.
222
223       -port portnum
224           Port to listen for OCSP requests on. The port may also be specified
225           using the url option.
226
227       -nrequest number
228           The OCSP server will exit after receiving number requests, default
229           unlimited.
230
231       -nmin minutes, -ndays days
232           Number of minutes or days when fresh revocation information is
233           available: used in the nextUpdate field. If neither option is
234           present then the nextUpdate field is omitted meaning fresh
235           revocation information is immediately available.
236

OCSP Response verification.

238       OCSP Response follows the rules specified in RFC2560.
239
240       Initially the OCSP responder certificate is located and the signature
241       on the OCSP request checked using the responder certificate's public
242       key.
243
244       Then a normal certificate verify is performed on the OCSP responder
245       certificate building up a certificate chain in the process. The
246       locations of the trusted certificates used to build the chain can be
247       specified by the CAfile and CApath options or they will be looked for
248       in the standard OpenSSL certificates directory.
249
250       If the initial verify fails then the OCSP verify process halts with an
251       error.
252
253       Otherwise the issuing CA certificate in the request is compared to the
254       OCSP responder certificate: if there is a match then the OCSP verify
255       succeeds.
256
257       Otherwise the OCSP responder certificate's CA is checked against the
258       issuing CA certificate in the request. If there is a match and the
259       OCSPSigning extended key usage is present in the OCSP responder
260       certificate then the OCSP verify succeeds.
261
262       Otherwise, if -no_explicit is not set the root CA of the OCSP
263       responders CA is checked to see if it is trusted for OCSP signing. If
264       it is the OCSP verify succeeds.
265
266       If none of these checks is successful then the OCSP verify fails.
267
268       What this effectively means if that if the OCSP responder certificate
269       is authorised directly by the CA it is issuing revocation information
270       about (and it is correctly configured) then verification will succeed.
271
272       If the OCSP responder is a "global responder" which can give details
273       about multiple CAs and has its own separate certificate chain then its
274       root CA can be trusted for OCSP signing. For example:
275
276        openssl x509 -in ocspCA.pem -addtrust OCSPSigning -out trustedCA.pem
277
278       Alternatively the responder certificate itself can be explicitly
279       trusted with the -VAfile option.
280

NOTES

282       As noted, most of the verify options are for testing or debugging
283       purposes.  Normally only the -CApath, -CAfile and (if the responder is
284       a 'global VA') -VAfile options need to be used.
285
286       The OCSP server is only useful for test and demonstration purposes: it
287       is not really usable as a full OCSP responder. It contains only a very
288       simple HTTP request handling and can only handle the POST form of OCSP
289       queries. It also handles requests serially meaning it cannot respond to
290       new requests until it has processed the current one. The text index
291       file format of revocation is also inefficient for large quantities of
292       revocation data.
293
294       It is possible to run the ocsp application in responder mode via a CGI
295       script using the respin and respout options.
296

EXAMPLES

298       Create an OCSP request and write it to a file:
299
300        openssl ocsp -issuer issuer.pem -cert c1.pem -cert c2.pem -reqout req.der
301
302       Send a query to an OCSP responder with URL http://ocsp.myhost.com/ save
303       the response to a file and print it out in text form
304
305        openssl ocsp -issuer issuer.pem -cert c1.pem -cert c2.pem \
306            -url http://ocsp.myhost.com/ -resp_text -respout resp.der
307
308       Read in an OCSP response and print out text form:
309
310        openssl ocsp -respin resp.der -text
311
312       OCSP server on port 8888 using a standard ca configuration, and a
313       separate responder certificate. All requests and responses are printed
314       to a file.
315
316        openssl ocsp -index demoCA/index.txt -port 8888 -rsigner rcert.pem -CA demoCA/cacert.pem
317               -text -out log.txt
318
319       As above but exit after processing one request:
320
321        openssl ocsp -index demoCA/index.txt -port 8888 -rsigner rcert.pem -CA demoCA/cacert.pem
322            -nrequest 1
323
324       Query status information using internally generated request:
325
326        openssl ocsp -index demoCA/index.txt -rsigner rcert.pem -CA demoCA/cacert.pem
327            -issuer demoCA/cacert.pem -serial 1
328
329       Query status information using request read from a file, write response
330       to a second file.
331
332        openssl ocsp -index demoCA/index.txt -rsigner rcert.pem -CA demoCA/cacert.pem
333            -reqin req.der -respout resp.der
334

HISTORY

336       The -no_alt_chains options was first added to OpenSSL 1.0.2b.
337
338
339
3401.0.2k                            2019-03-12                           OCSP(1)
Impressum