openssl-ocsp.1ossl 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587
  1. .\" -*- mode: troff; coding: utf-8 -*-
  2. .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43)
  3. .\"
  4. .\" Standard preamble:
  5. .\" ========================================================================
  6. .de Sp \" Vertical space (when we can't use .PP)
  7. .if t .sp .5v
  8. .if n .sp
  9. ..
  10. .de Vb \" Begin verbatim text
  11. .ft CW
  12. .nf
  13. .ne \\$1
  14. ..
  15. .de Ve \" End verbatim text
  16. .ft R
  17. .fi
  18. ..
  19. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
  20. .ie n \{\
  21. . ds C` ""
  22. . ds C' ""
  23. 'br\}
  24. .el\{\
  25. . ds C`
  26. . ds C'
  27. 'br\}
  28. .\"
  29. .\" Escape single quotes in literal strings from groff's Unicode transform.
  30. .ie \n(.g .ds Aq \(aq
  31. .el .ds Aq '
  32. .\"
  33. .\" If the F register is >0, we'll generate index entries on stderr for
  34. .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
  35. .\" entries marked with X<> in POD. Of course, you'll have to process the
  36. .\" output yourself in some meaningful fashion.
  37. .\"
  38. .\" Avoid warning from groff about undefined register 'F'.
  39. .de IX
  40. ..
  41. .nr rF 0
  42. .if \n(.g .if rF .nr rF 1
  43. .if (\n(rF:(\n(.g==0)) \{\
  44. . if \nF \{\
  45. . de IX
  46. . tm Index:\\$1\t\\n%\t"\\$2"
  47. ..
  48. . if !\nF==2 \{\
  49. . nr % 0
  50. . nr F 2
  51. . \}
  52. . \}
  53. .\}
  54. .rr rF
  55. .\" ========================================================================
  56. .\"
  57. .IX Title "OPENSSL-OCSP 1ossl"
  58. .TH OPENSSL-OCSP 1ossl 2025-01-17 3.4.0 OpenSSL
  59. .\" For nroff, turn off justification. Always turn off hyphenation; it makes
  60. .\" way too many mistakes in technical documents.
  61. .if n .ad l
  62. .nh
  63. .SH NAME
  64. openssl\-ocsp \- Online Certificate Status Protocol command
  65. .SH SYNOPSIS
  66. .IX Header "SYNOPSIS"
  67. .SS "OCSP Client"
  68. .IX Subsection "OCSP Client"
  69. \&\fBopenssl\fR \fBocsp\fR
  70. [\fB\-help\fR]
  71. [\fB\-out\fR \fIfile\fR]
  72. [\fB\-issuer\fR \fIfile\fR]
  73. [\fB\-cert\fR \fIfile\fR]
  74. [\fB\-no_certs\fR]
  75. [\fB\-serial\fR \fIn\fR]
  76. [\fB\-signer\fR \fIfile\fR]
  77. [\fB\-signkey\fR \fIfile\fR]
  78. [\fB\-sign_other\fR \fIfile\fR]
  79. [\fB\-nonce\fR]
  80. [\fB\-no_nonce\fR]
  81. [\fB\-req_text\fR]
  82. [\fB\-resp_text\fR]
  83. [\fB\-text\fR]
  84. [\fB\-reqout\fR \fIfile\fR]
  85. [\fB\-respout\fR \fIfile\fR]
  86. [\fB\-reqin\fR \fIfile\fR]
  87. [\fB\-respin\fR \fIfile\fR]
  88. [\fB\-url\fR \fIURL\fR]
  89. [\fB\-host\fR \fIhost\fR:\fIport\fR]
  90. [\fB\-path\fR \fIpathname\fR]
  91. [\fB\-proxy\fR \fI[http[s]://][userinfo@]host[:port][/path][?query][#fragment]\fR]
  92. [\fB\-no_proxy\fR \fIaddresses\fR]
  93. [\fB\-header\fR]
  94. [\fB\-timeout\fR \fIseconds\fR]
  95. [\fB\-VAfile\fR \fIfile\fR]
  96. [\fB\-validity_period\fR \fIn\fR]
  97. [\fB\-status_age\fR \fIn\fR]
  98. [\fB\-noverify\fR]
  99. [\fB\-verify_other\fR \fIfile\fR]
  100. [\fB\-trust_other\fR]
  101. [\fB\-no_intern\fR]
  102. [\fB\-no_signature_verify\fR]
  103. [\fB\-no_cert_verify\fR]
  104. [\fB\-no_chain\fR]
  105. [\fB\-no_cert_checks\fR]
  106. [\fB\-no_explicit\fR]
  107. [\fB\-port\fR \fInum\fR]
  108. [\fB\-ignore_err\fR]
  109. .SS "OCSP Server"
  110. .IX Subsection "OCSP Server"
  111. \&\fBopenssl\fR \fBocsp\fR
  112. [\fB\-index\fR \fIfile\fR]
  113. [\fB\-CA\fR \fIfile\fR]
  114. [\fB\-rsigner\fR \fIfile\fR]
  115. [\fB\-rkey\fR \fIfile\fR]
  116. [\fB\-passin\fR \fIarg\fR]
  117. [\fB\-rother\fR \fIfile\fR]
  118. [\fB\-rsigopt\fR \fInm\fR:\fIv\fR]
  119. [\fB\-rmd\fR \fIdigest\fR]
  120. [\fB\-badsig\fR]
  121. [\fB\-resp_no_certs\fR]
  122. [\fB\-nmin\fR \fIn\fR]
  123. [\fB\-ndays\fR \fIn\fR]
  124. [\fB\-resp_key_id\fR]
  125. [\fB\-nrequest\fR \fIn\fR]
  126. [\fB\-multi\fR \fIprocess-count\fR]
  127. [\fB\-rcid\fR \fIdigest\fR]
  128. [\fB\-\fR\f(BIdigest\fR]
  129. [\fB\-CAfile\fR \fIfile\fR]
  130. [\fB\-no\-CAfile\fR]
  131. [\fB\-CApath\fR \fIdir\fR]
  132. [\fB\-no\-CApath\fR]
  133. [\fB\-CAstore\fR \fIuri\fR]
  134. [\fB\-no\-CAstore\fR]
  135. [\fB\-allow_proxy_certs\fR]
  136. [\fB\-attime\fR \fItimestamp\fR]
  137. [\fB\-no_check_time\fR]
  138. [\fB\-check_ss_sig\fR]
  139. [\fB\-crl_check\fR]
  140. [\fB\-crl_check_all\fR]
  141. [\fB\-explicit_policy\fR]
  142. [\fB\-extended_crl\fR]
  143. [\fB\-ignore_critical\fR]
  144. [\fB\-inhibit_any\fR]
  145. [\fB\-inhibit_map\fR]
  146. [\fB\-partial_chain\fR]
  147. [\fB\-policy\fR \fIarg\fR]
  148. [\fB\-policy_check\fR]
  149. [\fB\-policy_print\fR]
  150. [\fB\-purpose\fR \fIpurpose\fR]
  151. [\fB\-suiteB_128\fR]
  152. [\fB\-suiteB_128_only\fR]
  153. [\fB\-suiteB_192\fR]
  154. [\fB\-trusted_first\fR]
  155. [\fB\-no_alt_chains\fR]
  156. [\fB\-use_deltas\fR]
  157. [\fB\-auth_level\fR \fInum\fR]
  158. [\fB\-verify_depth\fR \fInum\fR]
  159. [\fB\-verify_email\fR \fIemail\fR]
  160. [\fB\-verify_hostname\fR \fIhostname\fR]
  161. [\fB\-verify_ip\fR \fIip\fR]
  162. [\fB\-verify_name\fR \fIname\fR]
  163. [\fB\-x509_strict\fR]
  164. [\fB\-issuer_checks\fR]
  165. [\fB\-provider\fR \fIname\fR]
  166. [\fB\-provider\-path\fR \fIpath\fR]
  167. [\fB\-propquery\fR \fIpropq\fR]
  168. .SH DESCRIPTION
  169. .IX Header "DESCRIPTION"
  170. The Online Certificate Status Protocol (OCSP) enables applications to
  171. determine the (revocation) state of an identified certificate (RFC 2560).
  172. .PP
  173. This command performs many common OCSP tasks. It can be used
  174. to print out requests and responses, create requests and send queries
  175. to an OCSP responder and behave like a mini OCSP server itself.
  176. .SH OPTIONS
  177. .IX Header "OPTIONS"
  178. This command operates as either a client or a server.
  179. The options are described below, divided into those two modes.
  180. .SS "OCSP Client Options"
  181. .IX Subsection "OCSP Client Options"
  182. .IP \fB\-help\fR 4
  183. .IX Item "-help"
  184. Print out a usage message.
  185. .IP "\fB\-out\fR \fIfilename\fR" 4
  186. .IX Item "-out filename"
  187. specify output filename, default is standard output.
  188. .IP "\fB\-issuer\fR \fIfilename\fR" 4
  189. .IX Item "-issuer filename"
  190. This specifies the current issuer certificate.
  191. The input can be in PEM, DER, or PKCS#12 format.
  192. .Sp
  193. This option can be used multiple times.
  194. This option \fBMUST\fR come before any \fB\-cert\fR options.
  195. .IP "\fB\-cert\fR \fIfilename\fR" 4
  196. .IX Item "-cert filename"
  197. Add the certificate \fIfilename\fR to the request.
  198. The input can be in PEM, DER, or PKCS#12 format.
  199. .Sp
  200. This option can be used multiple times.
  201. The issuer certificate is taken from the previous \fB\-issuer\fR option,
  202. or an error occurs if no issuer certificate is specified.
  203. .IP \fB\-no_certs\fR 4
  204. .IX Item "-no_certs"
  205. Don't include any certificates in signed request.
  206. .IP "\fB\-serial\fR \fInum\fR" 4
  207. .IX Item "-serial num"
  208. Same as the \fB\-cert\fR option except the certificate with serial number
  209. \&\fBnum\fR is added to the request. The serial number is interpreted as a
  210. decimal integer unless preceded by \f(CW\*(C`0x\*(C'\fR. Negative integers can also
  211. be specified by preceding the value by a \f(CW\*(C`\-\*(C'\fR sign.
  212. .IP "\fB\-signer\fR \fIfilename\fR, \fB\-signkey\fR \fIfilename\fR" 4
  213. .IX Item "-signer filename, -signkey filename"
  214. Sign the OCSP request using the certificate specified in the \fB\-signer\fR
  215. option and the private key specified by the \fB\-signkey\fR option.
  216. The input can be in PEM, DER, or PKCS#12 format.
  217. .Sp
  218. If the \fB\-signkey\fR option is not present then the private key is read
  219. from the same file as the certificate. If neither option is specified then
  220. the OCSP request is not signed.
  221. .IP "\fB\-sign_other\fR \fIfilename\fR" 4
  222. .IX Item "-sign_other filename"
  223. Additional certificates to include in the signed request.
  224. The input can be in PEM, DER, or PKCS#12 format.
  225. .IP "\fB\-nonce\fR, \fB\-no_nonce\fR" 4
  226. .IX Item "-nonce, -no_nonce"
  227. Add an OCSP nonce extension to a request or disable OCSP nonce addition.
  228. Normally if an OCSP request is input using the \fB\-reqin\fR option no
  229. nonce is added: using the \fB\-nonce\fR option will force addition of a nonce.
  230. If an OCSP request is being created (using \fB\-cert\fR and \fB\-serial\fR options)
  231. a nonce is automatically added specifying \fB\-no_nonce\fR overrides this.
  232. .IP "\fB\-req_text\fR, \fB\-resp_text\fR, \fB\-text\fR" 4
  233. .IX Item "-req_text, -resp_text, -text"
  234. Print out the text form of the OCSP request, response or both respectively.
  235. .IP "\fB\-reqout\fR \fIfile\fR, \fB\-respout\fR \fIfile\fR" 4
  236. .IX Item "-reqout file, -respout file"
  237. Write out the DER encoded certificate request or response to \fIfile\fR.
  238. .IP "\fB\-reqin\fR \fIfile\fR, \fB\-respin\fR \fIfile\fR" 4
  239. .IX Item "-reqin file, -respin file"
  240. Read OCSP request or response file from \fIfile\fR. These option are ignored
  241. if OCSP request or response creation is implied by other options (for example
  242. with \fB\-serial\fR, \fB\-cert\fR and \fB\-host\fR options).
  243. .IP "\fB\-url\fR \fIresponder_url\fR" 4
  244. .IX Item "-url responder_url"
  245. Specify the responder host and optionally port and path via a URL.
  246. Both HTTP and HTTPS (SSL/TLS) URLs can be specified.
  247. The optional userinfo and fragment components are ignored.
  248. Any given query component is handled as part of the path component.
  249. For details, see the \fB\-host\fR and \fB\-path\fR options described next.
  250. .IP "\fB\-host\fR \fIhost\fR:\fIport\fR, \fB\-path\fR \fIpathname\fR" 4
  251. .IX Item "-host host:port, -path pathname"
  252. If the \fB\-host\fR option is present then the OCSP request is sent to the host
  253. \&\fIhost\fR on port \fIport\fR.
  254. The \fIhost\fR may be a domain name or an IP (v4 or v6) address,
  255. such as \f(CW127.0.0.1\fR or \f(CW\*(C`[::1]\*(C'\fR for localhost.
  256. If it is an IPv6 address, it must be enclosed in \f(CW\*(C`[\*(C'\fR and \f(CW\*(C`]\*(C'\fR.
  257. .Sp
  258. The \fB\-path\fR option specifies the HTTP pathname to use or "/" by default.
  259. This is equivalent to specifying \fB\-url\fR with scheme
  260. http:// and the given \fIhost\fR, \fIport\fR, and optional \fIpathname\fR.
  261. .IP "\fB\-proxy\fR \fI[http[s]://][userinfo@]host[:port][/path][?query][#fragment]\fR" 4
  262. .IX Item "-proxy [http[s]://][userinfo@]host[:port][/path][?query][#fragment]"
  263. The HTTP(S) proxy server to use for reaching the OCSP server unless \fB\-no_proxy\fR
  264. applies, see below.
  265. If the host string is an IPv6 address, it must be enclosed in \f(CW\*(C`[\*(C'\fR and \f(CW\*(C`]\*(C'\fR.
  266. The proxy port defaults to 80 or 443 if the scheme is \f(CW\*(C`https\*(C'\fR; apart from that
  267. the optional \f(CW\*(C`http://\*(C'\fR or \f(CW\*(C`https://\*(C'\fR prefix is ignored,
  268. as well as any userinfo, path, query, and fragment components.
  269. Defaults to the environment variable \f(CW\*(C`http_proxy\*(C'\fR if set, else \f(CW\*(C`HTTP_PROXY\*(C'\fR
  270. in case no TLS is used, otherwise \f(CW\*(C`https_proxy\*(C'\fR if set, else \f(CW\*(C`HTTPS_PROXY\*(C'\fR.
  271. .IP "\fB\-no_proxy\fR \fIaddresses\fR" 4
  272. .IX Item "-no_proxy addresses"
  273. List of IP addresses and/or DNS names of servers
  274. not to use an HTTP(S) proxy for, separated by commas and/or whitespace
  275. (where in the latter case the whole argument must be enclosed in "...").
  276. Default is from the environment variable \f(CW\*(C`no_proxy\*(C'\fR if set, else \f(CW\*(C`NO_PROXY\*(C'\fR.
  277. .IP "\fB\-header\fR \fIname\fR=\fIvalue\fR" 4
  278. .IX Item "-header name=value"
  279. Adds the header \fIname\fR with the specified \fIvalue\fR to the OCSP request
  280. that is sent to the responder.
  281. This may be repeated.
  282. .IP "\fB\-timeout\fR \fIseconds\fR" 4
  283. .IX Item "-timeout seconds"
  284. Connection timeout to the OCSP responder in seconds.
  285. On POSIX systems, when running as an OCSP responder, this option also limits
  286. the time that the responder is willing to wait for the client request.
  287. This time is measured from the time the responder accepts the connection until
  288. the complete request is received.
  289. .IP "\fB\-verify_other\fR \fIfile\fR" 4
  290. .IX Item "-verify_other file"
  291. File or URI containing additional certificates to search
  292. when attempting to locate
  293. the OCSP response signing certificate. Some responders omit the actual signer's
  294. certificate from the response: this option can be used to supply the necessary
  295. certificate in such cases.
  296. The input can be in PEM, DER, or PKCS#12 format.
  297. .IP \fB\-trust_other\fR 4
  298. .IX Item "-trust_other"
  299. The certificates specified by the \fB\-verify_other\fR option should be explicitly
  300. trusted and no additional checks will be performed on them. This is useful
  301. when the complete responder certificate chain is not available or trusting a
  302. root CA is not appropriate.
  303. .IP "\fB\-VAfile\fR \fIfile\fR" 4
  304. .IX Item "-VAfile file"
  305. File or URI containing explicitly trusted responder certificates.
  306. Equivalent to the \fB\-verify_other\fR and \fB\-trust_other\fR options.
  307. The input can be in PEM, DER, or PKCS#12 format.
  308. .IP \fB\-noverify\fR 4
  309. .IX Item "-noverify"
  310. Don't attempt to verify the OCSP response signature or the nonce
  311. values. This option will normally only be used for debugging since it
  312. disables all verification of the responders certificate.
  313. .IP \fB\-no_intern\fR 4
  314. .IX Item "-no_intern"
  315. Ignore certificates contained in the OCSP response when searching for the
  316. signers certificate. With this option the signers certificate must be specified
  317. with either the \fB\-verify_other\fR or \fB\-VAfile\fR options.
  318. .IP \fB\-no_signature_verify\fR 4
  319. .IX Item "-no_signature_verify"
  320. Don't check the signature on the OCSP response. Since this option
  321. tolerates invalid signatures on OCSP responses it will normally only be
  322. used for testing purposes.
  323. .IP \fB\-no_cert_verify\fR 4
  324. .IX Item "-no_cert_verify"
  325. Don't verify the OCSP response signers certificate at all. Since this
  326. option allows the OCSP response to be signed by any certificate it should
  327. only be used for testing purposes.
  328. .IP \fB\-no_chain\fR 4
  329. .IX Item "-no_chain"
  330. Do not use certificates in the response as additional untrusted CA
  331. certificates.
  332. .IP \fB\-no_explicit\fR 4
  333. .IX Item "-no_explicit"
  334. Do not explicitly trust the root CA if it is set to be trusted for OCSP signing.
  335. .IP \fB\-no_cert_checks\fR 4
  336. .IX Item "-no_cert_checks"
  337. Don't perform any additional checks on the OCSP response signers certificate.
  338. That is do not make any checks to see if the signers certificate is authorised
  339. to provide the necessary status information: as a result this option should
  340. only be used for testing purposes.
  341. .IP "\fB\-validity_period\fR \fInsec\fR, \fB\-status_age\fR \fIage\fR" 4
  342. .IX Item "-validity_period nsec, -status_age age"
  343. These options specify the range of times, in seconds, which will be tolerated
  344. in an OCSP response. Each certificate status response includes a \fBnotBefore\fR
  345. time and an optional \fBnotAfter\fR time. The current time should fall between
  346. these two values, but the interval between the two times may be only a few
  347. seconds. In practice the OCSP responder and clients clocks may not be precisely
  348. synchronised and so such a check may fail. To avoid this the
  349. \&\fB\-validity_period\fR option can be used to specify an acceptable error range in
  350. seconds, the default value is 5 minutes.
  351. .Sp
  352. If the \fBnotAfter\fR time is omitted from a response then this means that new
  353. status information is immediately available. In this case the age of the
  354. \&\fBnotBefore\fR field is checked to see it is not older than \fIage\fR seconds old.
  355. By default this additional check is not performed.
  356. .IP "\fB\-rcid\fR \fIdigest\fR" 4
  357. .IX Item "-rcid digest"
  358. This option sets the digest algorithm to use for certificate identification
  359. in the OCSP response. Any digest supported by the \fBopenssl\-dgst\fR\|(1) command can
  360. be used. The default is the same digest algorithm used in the request.
  361. .IP \fB\-\fR\f(BIdigest\fR 4
  362. .IX Item "-digest"
  363. This option sets digest algorithm to use for certificate identification in the
  364. OCSP request. Any digest supported by the OpenSSL \fBdgst\fR command can be used.
  365. The default is SHA\-1. This option may be used multiple times to specify the
  366. digest used by subsequent certificate identifiers.
  367. .IP "\fB\-CAfile\fR \fIfile\fR, \fB\-no\-CAfile\fR, \fB\-CApath\fR \fIdir\fR, \fB\-no\-CApath\fR, \fB\-CAstore\fR \fIuri\fR, \fB\-no\-CAstore\fR" 4
  368. .IX Item "-CAfile file, -no-CAfile, -CApath dir, -no-CApath, -CAstore uri, -no-CAstore"
  369. See "Trusted Certificate Options" in \fBopenssl\-verification\-options\fR\|(1) for details.
  370. .IP "\fB\-allow_proxy_certs\fR, \fB\-attime\fR, \fB\-no_check_time\fR, \fB\-check_ss_sig\fR, \fB\-crl_check\fR, \fB\-crl_check_all\fR, \fB\-explicit_policy\fR, \fB\-extended_crl\fR, \fB\-ignore_critical\fR, \fB\-inhibit_any\fR, \fB\-inhibit_map\fR, \fB\-no_alt_chains\fR, \fB\-partial_chain\fR, \fB\-policy\fR, \fB\-policy_check\fR, \fB\-policy_print\fR, \fB\-purpose\fR, \fB\-suiteB_128\fR, \fB\-suiteB_128_only\fR, \fB\-suiteB_192\fR, \fB\-trusted_first\fR, \fB\-use_deltas\fR, \fB\-auth_level\fR, \fB\-verify_depth\fR, \fB\-verify_email\fR, \fB\-verify_hostname\fR, \fB\-verify_ip\fR, \fB\-verify_name\fR, \fB\-x509_strict\fR \fB\-issuer_checks\fR" 4
  371. .IX Item "-allow_proxy_certs, -attime, -no_check_time, -check_ss_sig, -crl_check, -crl_check_all, -explicit_policy, -extended_crl, -ignore_critical, -inhibit_any, -inhibit_map, -no_alt_chains, -partial_chain, -policy, -policy_check, -policy_print, -purpose, -suiteB_128, -suiteB_128_only, -suiteB_192, -trusted_first, -use_deltas, -auth_level, -verify_depth, -verify_email, -verify_hostname, -verify_ip, -verify_name, -x509_strict -issuer_checks"
  372. Set various options of certificate chain verification.
  373. See "Verification Options" in \fBopenssl\-verification\-options\fR\|(1) for details.
  374. .IP "\fB\-provider\fR \fIname\fR" 4
  375. .IX Item "-provider name"
  376. .PD 0
  377. .IP "\fB\-provider\-path\fR \fIpath\fR" 4
  378. .IX Item "-provider-path path"
  379. .IP "\fB\-propquery\fR \fIpropq\fR" 4
  380. .IX Item "-propquery propq"
  381. .PD
  382. See "Provider Options" in \fBopenssl\fR\|(1), \fBprovider\fR\|(7), and \fBproperty\fR\|(7).
  383. .SS "OCSP Server Options"
  384. .IX Subsection "OCSP Server Options"
  385. .IP "\fB\-index\fR \fIindexfile\fR" 4
  386. .IX Item "-index indexfile"
  387. The \fIindexfile\fR parameter is the name of a text index file in \fBca\fR
  388. format containing certificate revocation information.
  389. .Sp
  390. If the \fB\-index\fR option is specified then this command switches to
  391. responder mode, otherwise it is in client mode. The request(s) the responder
  392. processes can be either specified on the command line (using \fB\-issuer\fR
  393. and \fB\-serial\fR options), supplied in a file (using the \fB\-reqin\fR option)
  394. or via external OCSP clients (if \fB\-port\fR or \fB\-url\fR is specified).
  395. .Sp
  396. If the \fB\-index\fR option is present then the \fB\-CA\fR and \fB\-rsigner\fR options
  397. must also be present.
  398. .IP "\fB\-CA\fR \fIfile\fR" 4
  399. .IX Item "-CA file"
  400. CA certificates corresponding to the revocation information in the index
  401. file given with \fB\-index\fR.
  402. The input can be in PEM, DER, or PKCS#12 format.
  403. .IP "\fB\-rsigner\fR \fIfile\fR" 4
  404. .IX Item "-rsigner file"
  405. The certificate to sign OCSP responses with.
  406. The input can be in PEM, DER, or PKCS#12 format.
  407. .IP "\fB\-rkey\fR \fIfile\fR" 4
  408. .IX Item "-rkey file"
  409. The private key to sign OCSP responses with: if not present the file
  410. specified in the \fB\-rsigner\fR option is used.
  411. .IP "\fB\-passin\fR \fIarg\fR" 4
  412. .IX Item "-passin arg"
  413. The private key password source. For more information about the format of \fIarg\fR
  414. see \fBopenssl\-passphrase\-options\fR\|(1).
  415. .IP "\fB\-rother\fR \fIfile\fR" 4
  416. .IX Item "-rother file"
  417. Additional certificates to include in the OCSP response.
  418. The input can be in PEM, DER, or PKCS#12 format.
  419. .IP "\fB\-rsigopt\fR \fInm\fR:\fIv\fR" 4
  420. .IX Item "-rsigopt nm:v"
  421. Pass options to the signature algorithm when signing OCSP responses.
  422. Names and values of these options are algorithm-specific.
  423. .IP "\fB\-rmd\fR \fIdigest\fR" 4
  424. .IX Item "-rmd digest"
  425. The digest to use when signing the response.
  426. .IP \fB\-badsig\fR 4
  427. .IX Item "-badsig"
  428. Corrupt the response signature before writing it; this can be useful
  429. for testing.
  430. .IP \fB\-resp_no_certs\fR 4
  431. .IX Item "-resp_no_certs"
  432. Don't include any certificates in the OCSP response.
  433. .IP \fB\-resp_key_id\fR 4
  434. .IX Item "-resp_key_id"
  435. Identify the signer certificate using the key ID, default is to use the
  436. subject name.
  437. .IP "\fB\-port\fR \fIportnum\fR" 4
  438. .IX Item "-port portnum"
  439. Port to listen for OCSP requests on. Both IPv4 and IPv6 are possible.
  440. The port may also be specified using the \fB\-url\fR option.
  441. A \f(CW0\fR argument indicates that any available port shall be chosen automatically.
  442. .IP \fB\-ignore_err\fR 4
  443. .IX Item "-ignore_err"
  444. Ignore malformed requests or responses: When acting as an OCSP client, retry if
  445. a malformed response is received. When acting as an OCSP responder, continue
  446. running instead of terminating upon receiving a malformed request.
  447. .IP "\fB\-nrequest\fR \fInumber\fR" 4
  448. .IX Item "-nrequest number"
  449. The OCSP server will exit after receiving \fInumber\fR requests, default unlimited.
  450. .IP "\fB\-multi\fR \fIprocess-count\fR" 4
  451. .IX Item "-multi process-count"
  452. Run the specified number of OCSP responder child processes, with the parent
  453. process respawning child processes as needed.
  454. Child processes will detect changes in the CA index file and automatically
  455. reload it.
  456. When running as a responder \fB\-timeout\fR option is recommended to limit the time
  457. each child is willing to wait for the client's OCSP response.
  458. This option is available on POSIX systems (that support the \fBfork()\fR and other
  459. required unix system-calls).
  460. .IP "\fB\-nmin\fR \fIminutes\fR, \fB\-ndays\fR \fIdays\fR" 4
  461. .IX Item "-nmin minutes, -ndays days"
  462. Number of minutes or days when fresh revocation information is available:
  463. used in the \fBnextUpdate\fR field. If neither option is present then the
  464. \&\fBnextUpdate\fR field is omitted meaning fresh revocation information is
  465. immediately available.
  466. .SH "OCSP RESPONSE VERIFICATION"
  467. .IX Header "OCSP RESPONSE VERIFICATION"
  468. OCSP Response follows the rules specified in RFC2560.
  469. .PP
  470. Initially the OCSP responder certificate is located and the signature on
  471. the OCSP request checked using the responder certificate's public key.
  472. .PP
  473. Then a normal certificate verify is performed on the OCSP responder certificate
  474. building up a certificate chain in the process. The locations of the trusted
  475. certificates used to build the chain can be specified by the \fB\-CAfile\fR,
  476. \&\fB\-CApath\fR or \fB\-CAstore\fR options or they will be looked for in the
  477. standard OpenSSL certificates directory.
  478. .PP
  479. If the initial verify fails then the OCSP verify process halts with an
  480. error.
  481. .PP
  482. Otherwise the issuing CA certificate in the request is compared to the OCSP
  483. responder certificate: if there is a match then the OCSP verify succeeds.
  484. .PP
  485. Otherwise the OCSP responder certificate's CA is checked against the issuing
  486. CA certificate in the request. If there is a match and the OCSPSigning
  487. extended key usage is present in the OCSP responder certificate then the
  488. OCSP verify succeeds.
  489. .PP
  490. Otherwise, if \fB\-no_explicit\fR is \fBnot\fR set the root CA of the OCSP responders
  491. CA is checked to see if it is trusted for OCSP signing. If it is the OCSP
  492. verify succeeds.
  493. .PP
  494. If none of these checks is successful then the OCSP verify fails.
  495. .PP
  496. What this effectively means if that if the OCSP responder certificate is
  497. authorised directly by the CA it is issuing revocation information about
  498. (and it is correctly configured) then verification will succeed.
  499. .PP
  500. If the OCSP responder is a "global responder" which can give details about
  501. multiple CAs and has its own separate certificate chain then its root
  502. CA can be trusted for OCSP signing. For example:
  503. .PP
  504. .Vb 1
  505. \& openssl x509 \-in ocspCA.pem \-addtrust OCSPSigning \-out trustedCA.pem
  506. .Ve
  507. .PP
  508. Alternatively the responder certificate itself can be explicitly trusted
  509. with the \fB\-VAfile\fR option.
  510. .SH NOTES
  511. .IX Header "NOTES"
  512. As noted, most of the verify options are for testing or debugging purposes.
  513. Normally only the \fB\-CApath\fR, \fB\-CAfile\fR, \fB\-CAstore\fR and (if the responder
  514. is a 'global VA') \fB\-VAfile\fR options need to be used.
  515. .PP
  516. The OCSP server is only useful for test and demonstration purposes: it is
  517. not really usable as a full OCSP responder. It contains only a very
  518. simple HTTP request handling and can only handle the POST form of OCSP
  519. queries. It also handles requests serially meaning it cannot respond to
  520. new requests until it has processed the current one. The text index file
  521. format of revocation is also inefficient for large quantities of revocation
  522. data.
  523. .PP
  524. It is possible to run this command in responder mode via a CGI
  525. script using the \fB\-reqin\fR and \fB\-respout\fR options.
  526. .SH EXAMPLES
  527. .IX Header "EXAMPLES"
  528. Create an OCSP request and write it to a file:
  529. .PP
  530. .Vb 1
  531. \& openssl ocsp \-issuer issuer.pem \-cert c1.pem \-cert c2.pem \-reqout req.der
  532. .Ve
  533. .PP
  534. Send a query to an OCSP responder with URL http://ocsp.myhost.com/ save the
  535. response to a file, print it out in text form, and verify the response:
  536. .PP
  537. .Vb 2
  538. \& openssl ocsp \-issuer issuer.pem \-cert c1.pem \-cert c2.pem \e
  539. \& \-url http://ocsp.myhost.com/ \-resp_text \-respout resp.der
  540. .Ve
  541. .PP
  542. Read in an OCSP response and print out text form:
  543. .PP
  544. .Vb 1
  545. \& openssl ocsp \-respin resp.der \-text \-noverify
  546. .Ve
  547. .PP
  548. OCSP server on port 8888 using a standard \fBca\fR configuration, and a separate
  549. responder certificate. All requests and responses are printed to a file.
  550. .PP
  551. .Vb 2
  552. \& openssl ocsp \-index demoCA/index.txt \-port 8888 \-rsigner rcert.pem \-CA demoCA/cacert.pem
  553. \& \-text \-out log.txt
  554. .Ve
  555. .PP
  556. As above but exit after processing one request:
  557. .PP
  558. .Vb 2
  559. \& openssl ocsp \-index demoCA/index.txt \-port 8888 \-rsigner rcert.pem \-CA demoCA/cacert.pem
  560. \& \-nrequest 1
  561. .Ve
  562. .PP
  563. Query status information using an internally generated request:
  564. .PP
  565. .Vb 2
  566. \& openssl ocsp \-index demoCA/index.txt \-rsigner rcert.pem \-CA demoCA/cacert.pem
  567. \& \-issuer demoCA/cacert.pem \-serial 1
  568. .Ve
  569. .PP
  570. Query status information using request read from a file, and write the response
  571. to a second file.
  572. .PP
  573. .Vb 2
  574. \& openssl ocsp \-index demoCA/index.txt \-rsigner rcert.pem \-CA demoCA/cacert.pem
  575. \& \-reqin req.der \-respout resp.der
  576. .Ve
  577. .SH HISTORY
  578. .IX Header "HISTORY"
  579. The \-no_alt_chains option was added in OpenSSL 1.1.0.
  580. .SH COPYRIGHT
  581. .IX Header "COPYRIGHT"
  582. Copyright 2001\-2024 The OpenSSL Project Authors. All Rights Reserved.
  583. .PP
  584. Licensed under the Apache License 2.0 (the "License"). You may not use
  585. this file except in compliance with the License. You can obtain a copy
  586. in the file LICENSE in the source distribution or at
  587. <https://www.openssl.org/source/license.html>.