1OCSP(1) OpenSSL OCSP(1)
2
3
4
6 ocsp - Online Certificate Status Protocol utility
7
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 [-path] [-CApath dir] [-CAfile file] [-VAfile file] [-validity_period
14 n] [-status_age n] [-noverify] [-verify_other file] [-trust_other]
15 [-no_intern] [-no_signature_verify] [-no_cert_verify] [-no_chain]
16 [-no_cert_checks] [-port num] [-index file] [-CA file] [-rsigner file]
17 [-rkey file] [-rother file] [-resp_no_certs] [-nmin n] [-ndays n]
18 [-resp_key_id] [-nrequest n]
19
21 The Online Certificate Status Protocol (OCSP) enables applications to
22 determine the (revocation) state of an identified certificate (RFC
23 2560).
24
25 The ocsp command performs many common OCSP tasks. It can be used to
26 print out requests and responses, create requests and send queries to
27 an OCSP responder and behave like a mini OCSP server itself.
28
30 -out filename
31 specify output filename, default is standard output.
32
33 -issuer filename
34 This specifies the current issuer certificate. This option can be
35 used multiple times. The certificate specified in filename must be
36 in PEM format.
37
38 -cert filename
39 Add the certificate filename to the request. The issuer certificate
40 is taken from the previous issuer option, or an error occurs if no
41 issuer certificate is specified.
42
43 -serial num
44 Same as the cert option except the certificate with serial number
45 num is added to the request. The serial number is interpreted as a
46 decimal integer unless preceded by 0x. Negative integers can also
47 be specified by preceding the value by a - sign.
48
49 -signer filename, -signkey filename
50 Sign the OCSP request using the certificate specified in the signer
51 option and the private key specified by the signkey option. If the
52 signkey option is not present then the private key is read from the
53 same file as the certificate. If neither option is specified then
54 the OCSP request is not signed.
55
56 -sign_other filename
57 Additional certificates to include in the signed request.
58
59 -nonce, -no_nonce
60 Add an OCSP nonce extension to a request or disable OCSP nonce
61 addition. Normally if an OCSP request is input using the respin
62 option no nonce is added: using the nonce option will force addi‐
63 tion of a nonce. If an OCSP request is being created (using cert
64 and serial options) a nonce is automatically added specifying
65 no_nonce overrides this.
66
67 -req_text, -resp_text, -text
68 print out the text form of the OCSP request, response or both
69 respectively.
70
71 -reqout file, -respout file
72 write out the DER encoded certificate request or response to file.
73
74 -reqin file, -respin file
75 read OCSP request or response file from file. These option are
76 ignored if OCSP request or response creation is implied by other
77 options (for example with serial, cert and host options).
78
79 -url responder_url
80 specify the responder URL. Both HTTP and HTTPS (SSL/TLS) URLs can
81 be specified.
82
83 -host hostname:port, -path pathname
84 if the host option is present then the OCSP request is sent to the
85 host hostname on port port. path specifies the HTTP path name to
86 use or "/" by default.
87
88 -CAfile file, -CApath pathname
89 file or pathname containing trusted CA certificates. These are used
90 to verify the signature on the OCSP response.
91
92 -verify_other file
93 file containing additional certificates to search when attempting
94 to locate the OCSP response signing certificate. Some responders
95 omit the actual signer's certificate from the response: this option
96 can be used to supply the necessary certificate in such cases.
97
98 -trust_other
99 the certificates specified by the -verify_certs option should be
100 explicitly trusted and no additional checks will be performed on
101 them. This is useful when the complete responder certificate chain
102 is not available or trusting a root CA is not appropriate.
103
104 -VAfile file
105 file containing explicitly trusted responder certificates. Equiva‐
106 lent to the -verify_certs and -trust_other options.
107
108 -noverify
109 don't attempt to verify the OCSP response signature or the nonce
110 values. This option will normally only be used for debugging since
111 it disables all verification of the responders certificate.
112
113 -no_intern
114 ignore certificates contained in the OCSP response when searching
115 for the signers certificate. With this option the signers certifi‐
116 cate must be specified with either the -verify_certs or -VAfile
117 options.
118
119 -no_signature_verify
120 don't check the signature on the OCSP response. Since this option
121 tolerates invalid signatures on OCSP responses it will normally
122 only be used for testing purposes.
123
124 -no_cert_verify
125 don't verify the OCSP response signers certificate at all. Since
126 this option allows the OCSP response to be signed by any certifi‐
127 cate it should only be used for testing purposes.
128
129 -no_chain
130 do not use certificates in the response as additional untrusted CA
131 certificates.
132
133 -no_cert_checks
134 don't perform any additional checks on the OCSP response signers
135 certificate. That is do not make any checks to see if the signers
136 certificate is authorised to provide the necessary status informa‐
137 tion: as a result this option should only be used for testing pur‐
138 poses.
139
140 -validity_period nsec, -status_age age
141 these options specify the range of times, in seconds, which will be
142 tolerated in an OCSP response. Each certificate status response
143 includes a notBefore time and an optional notAfter time. The cur‐
144 rent time should fall between these two values, but the interval
145 between the two times may be only a few seconds. In practice the
146 OCSP responder and clients clocks may not be precisely synchronised
147 and so such a check may fail. To avoid this the -validity_period
148 option can be used to specify an acceptable error range in seconds,
149 the default value is 5 minutes.
150
151 If the notAfter time is omitted from a response then this means
152 that new status information is immediately available. In this case
153 the age of the notBefore field is checked to see it is not older
154 than age seconds old. By default this additional check is not per‐
155 formed.
156
158 -index indexfile
159 indexfile is a text index file in ca format containing certificate
160 revocation information.
161
162 If the index option is specified the ocsp utility is in responder
163 mode, otherwise it is in client mode. The request(s) the responder
164 processes can be either specified on the command line (using issuer
165 and serial options), supplied in a file (using the respin option)
166 or via external OCSP clients (if port or url is specified).
167
168 If the index option is present then the CA and rsigner options must
169 also be present.
170
171 -CA file
172 CA certificate corresponding to the revocation information in
173 indexfile.
174
175 -rsigner file
176 The certificate to sign OCSP responses with.
177
178 -rother file
179 Additional certificates to include in the OCSP response.
180
181 -resp_no_certs
182 Don't include any certificates in the OCSP response.
183
184 -resp_key_id
185 Identify the signer certificate using the key ID, default is to use
186 the subject name.
187
188 -rkey file
189 The private key to sign OCSP responses with: if not present the
190 file specified in the rsigner option is used.
191
192 -port portnum
193 Port to listen for OCSP requests on. The port may also be specified
194 using the url option.
195
196 -nrequest number
197 The OCSP server will exit after receiving number requests, default
198 unlimited.
199
200 -nmin minutes, -ndays days
201 Number of minutes or days when fresh revocation information is
202 available: used in the nextUpdate field. If neither option is
203 present then the nextUpdate field is omitted meaning fresh revoca‐
204 tion information is immediately available.
205
207 OCSP Response follows the rules specified in RFC2560.
208
209 Initially the OCSP responder certificate is located and the signature
210 on the OCSP request checked using the responder certificate's public
211 key.
212
213 Then a normal certificate verify is performed on the OCSP responder
214 certificate building up a certificate chain in the process. The loca‐
215 tions of the trusted certificates used to build the chain can be speci‐
216 fied by the CAfile and CApath options or they will be looked for in the
217 standard OpenSSL certificates directory.
218
219 If the initial verify fails then the OCSP verify process halts with an
220 error.
221
222 Otherwise the issuing CA certificate in the request is compared to the
223 OCSP responder certificate: if there is a match then the OCSP verify
224 succeeds.
225
226 Otherwise the OCSP responder certificate's CA is checked against the
227 issuing CA certificate in the request. If there is a match and the
228 OCSPSigning extended key usage is present in the OCSP responder cer‐
229 tificate then the OCSP verify succeeds.
230
231 Otherwise the root CA of the OCSP responders CA is checked to see if it
232 is trusted for OCSP signing. If it is the OCSP verify succeeds.
233
234 If none of these checks is successful then the OCSP verify fails.
235
236 What this effectively means if that if the OCSP responder certificate
237 is authorised directly by the CA it is issuing revocation information
238 about (and it is correctly configured) then verification will succeed.
239
240 If the OCSP responder is a "global responder" which can give details
241 about multiple CAs and has its own separate certificate chain then its
242 root CA can be trusted for OCSP signing. For example:
243
244 openssl x509 -in ocspCA.pem -addtrust OCSPSigning -out trustedCA.pem
245
246 Alternatively the responder certificate itself can be explicitly
247 trusted with the -VAfile option.
248
250 As noted, most of the verify options are for testing or debugging pur‐
251 poses. Normally only the -CApath, -CAfile and (if the responder is a
252 'global VA') -VAfile options need to be used.
253
254 The OCSP server is only useful for test and demonstration purposes: it
255 is not really usable as a full OCSP responder. It contains only a very
256 simple HTTP request handling and can only handle the POST form of OCSP
257 queries. It also handles requests serially meaning it cannot respond to
258 new requests until it has processed the current one. The text index
259 file format of revocation is also inefficient for large quantities of
260 revocation data.
261
262 It is possible to run the ocsp application in responder mode via a CGI
263 script using the respin and respout options.
264
266 Create an OCSP request and write it to a file:
267
268 openssl ocsp -issuer issuer.pem -cert c1.pem -cert c2.pem -reqout req.der
269
270 Send a query to an OCSP responder with URL http://ocsp.myhost.com/ save
271 the response to a file and print it out in text form
272
273 openssl ocsp -issuer issuer.pem -cert c1.pem -cert c2.pem \
274 -url http://ocsp.myhost.com/ -resp_text -respout resp.der
275
276 Read in an OCSP response and print out text form:
277
278 openssl ocsp -respin resp.der -text
279
280 OCSP server on port 8888 using a standard ca configuration, and a sepa‐
281 rate responder certificate. All requests and responses are printed to a
282 file.
283
284 openssl ocsp -index demoCA/index.txt -port 8888 -rsigner rcert.pem -CA demoCA/cacert.pem
285 -text -out log.txt
286
287 As above but exit after processing one request:
288
289 openssl ocsp -index demoCA/index.txt -port 8888 -rsigner rcert.pem -CA demoCA/cacert.pem
290 -nrequest 1
291
292 Query status information using internally generated request:
293
294 openssl ocsp -index demoCA/index.txt -rsigner rcert.pem -CA demoCA/cacert.pem
295 -issuer demoCA/cacert.pem -serial 1
296
297 Query status information using request read from a file, write response
298 to a second file.
299
300 openssl ocsp -index demoCA/index.txt -rsigner rcert.pem -CA demoCA/cacert.pem
301 -reqin req.der -respout resp.der
302
303
304
3050.9.8b 2003-03-25 OCSP(1)