xref: /freebsd/secure/usr.bin/openssl/man/openssl-ocsp.1 (revision 535af610a4fdace6d50960c0ad9be0597eea7a1b)
Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40)

Standard preamble:
========================================================================
..
..
.. Set up some character translations and predefined strings. \*(-- will
give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
double quote, and \*(R" will give a right double quote. \*(C+ will
give a nicer C++. Capital omega is used to do unbreakable dashes and
therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
nothing in troff, for use with C<>.
.tr \(*W- . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\}
Escape single quotes in literal strings from groff's Unicode transform.

If the F register is >0, we'll generate index entries on stderr for
titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
entries marked with X<> in POD. Of course, you'll have to process the
output yourself in some meaningful fashion.

Avoid warning from groff about undefined register 'F'.
.. .nr rF 0 . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF
Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
Fear. Run. Save yourself. No user-serviceable parts.
. \" fudge factors for nroff and troff . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] .\} . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents . \" corrections for vroff . \" for low resolution devices (crt and lpr) \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} ========================================================================

Title "OPENSSL-OCSP 1"
OPENSSL-OCSP 1 "2023-08-02" "3.0.10" "OpenSSL"
For nroff, turn off justification. Always turn off hyphenation; it makes
way too many mistakes in technical documents.
"NAME"
openssl-ocsp - Online Certificate Status Protocol command
"SYNOPSIS"
Header "SYNOPSIS"
"\s-1OCSP\s0 Client"
Subsection "OCSP Client" \fBopenssl ocsp [-help] [-out file] [-issuer file] [-cert file] [-no_certs] [-serial n] [-signer file] [-signkey file] [-sign_other file] [-nonce] [-no_nonce] [-req_text] [-resp_text] [-text] [-reqout file] [-respout file] [-reqin file] [-respin file] [-url \s-1URL\s0] [-host host:port] [-path] [-proxy [http[s]://][userinfo@]host[:port][/path]] [-no_proxy addresses] [-header] [-timeout seconds] [-VAfile file] [-validity_period n] [-status_age n] [-noverify] [-verify_other file] [-trust_other] [-no_intern] [-no_signature_verify] [-no_cert_verify] [-no_chain] [-no_cert_checks] [-no_explicit] [-port num] [-ignore_err]
"\s-1OCSP\s0 Server"
Subsection "OCSP Server" \fBopenssl ocsp [-index file] [-CA file] [-rsigner file] [-rkey file] [-passin arg] [-rother file] [-rsigopt nm:v] [-rmd digest] [-badsig] [-resp_no_certs] [-nmin n] [-ndays n] [-resp_key_id] [-nrequest n] [-multi process-count] [-rcid digest] [-\f(BIdigest] [-CAfile file] [-no-CAfile] [-CApath dir] [-no-CApath] [-CAstore uri] [-no-CAstore] [-allow_proxy_certs] [-attime timestamp] [-no_check_time] [-check_ss_sig] [-crl_check] [-crl_check_all] [-explicit_policy] [-extended_crl] [-ignore_critical] [-inhibit_any] [-inhibit_map] [-partial_chain] [-policy arg] [-policy_check] [-policy_print] [-purpose purpose] [-suiteB_128] [-suiteB_128_only] [-suiteB_192] [-trusted_first] [-no_alt_chains] [-use_deltas] [-auth_level num] [-verify_depth num] [-verify_email email] [-verify_hostname hostname] [-verify_ip ip] [-verify_name name] [-x509_strict] [-issuer_checks] [-provider name] [-provider-path path] [-propquery propq]
"DESCRIPTION"
Header "DESCRIPTION" The Online Certificate Status Protocol (\s-1OCSP\s0) enables applications to determine the (revocation) state of an identified certificate (\s-1RFC 2560\s0).

This command performs many common \s-1OCSP\s0 tasks. It can be used to print out requests and responses, create requests and send queries to an \s-1OCSP\s0 responder and behave like a mini \s-1OCSP\s0 server itself.

"OPTIONS"
Header "OPTIONS" This command operates as either a client or a server. The options are described below, divided into those two modes.
"\s-1OCSP\s0 Client Options"
Subsection "OCSP Client Options"
"-help" 4
Item "-help" Print out a usage message.
"-out filename" 4
Item "-out filename" specify output filename, default is standard output.
"-issuer filename" 4
Item "-issuer filename" This specifies the current issuer certificate. This option can be used multiple times. This option \s-1MUST\s0 come before any -cert options.
"-cert filename" 4
Item "-cert filename" Add the certificate filename to the request. The issuer certificate is taken from the previous -issuer option, or an error occurs if no issuer certificate is specified.
"-no_certs" 4
Item "-no_certs" Don't include any certificates in signed request.
"-serial num" 4
Item "-serial num" Same as the -cert option except the certificate with serial number \fBnum is added to the request. The serial number is interpreted as a decimal integer unless preceded by \*(C`0x\*(C'. Negative integers can also be specified by preceding the value by a \*(C`-\*(C' sign.
"-signer filename, -signkey filename" 4
Item "-signer filename, -signkey filename" Sign the \s-1OCSP\s0 request using the certificate specified in the -signer option and the private key specified by the -signkey option. If the -signkey option is not present then the private key is read from the same file as the certificate. If neither option is specified then the \s-1OCSP\s0 request is not signed.
"-sign_other filename" 4
Item "-sign_other filename" Additional certificates to include in the signed request. The input can be in \s-1PEM, DER,\s0 or PKCS#12 format.
"-nonce, -no_nonce" 4
Item "-nonce, -no_nonce" Add an \s-1OCSP\s0 nonce extension to a request or disable \s-1OCSP\s0 nonce addition. Normally if an \s-1OCSP\s0 request is input using the -reqin option no nonce is added: using the -nonce option will force addition of a nonce. If an \s-1OCSP\s0 request is being created (using -cert and -serial options) a nonce is automatically added specifying -no_nonce overrides this.
"-req_text, -resp_text, -text" 4
Item "-req_text, -resp_text, -text" Print out the text form of the \s-1OCSP\s0 request, response or both respectively.
"-reqout file, -respout file" 4
Item "-reqout file, -respout file" Write out the \s-1DER\s0 encoded certificate request or response to file.
"-reqin file, -respin file" 4
Item "-reqin file, -respin file" Read \s-1OCSP\s0 request or response file from file. These option are ignored if \s-1OCSP\s0 request or response creation is implied by other options (for example with -serial, -cert and -host options).
"-url responder_url" 4
Item "-url responder_url" Specify the responder \s-1URL.\s0 Both \s-1HTTP\s0 and \s-1HTTPS\s0 (\s-1SSL/TLS\s0) URLs can be specified. The optional userinfo and fragment components are ignored. Any given query component is handled as part of the path component.
"-host hostname:port, -path pathname" 4
Item "-host hostname:port, -path pathname" If the -host option is present then the \s-1OCSP\s0 request is sent to the host \fIhostname on port port. The -path option specifies the \s-1HTTP\s0 pathname to use or \*(L"/\*(R" by default. This is equivalent to specifying -url with scheme http:// and the given hostname, port, and pathname.
"-proxy [http[s]://][userinfo@]host[:port][/path]" 4
Item "-proxy [http[s]://][userinfo@]host[:port][/path]" The \s-1HTTP\s0(S) proxy server to use for reaching the \s-1OCSP\s0 server unless -no_proxy applies, see below. The proxy port defaults to 80 or 443 if the scheme is \*(C`https\*(C'; apart from that the optional \*(C`http://\*(C' or \*(C`https://\*(C' prefix is ignored, as well as any userinfo and path components. Defaults to the environment variable \*(C`http_proxy\*(C' if set, else \*(C`HTTP_PROXY\*(C' in case no \s-1TLS\s0 is used, otherwise \*(C`https_proxy\*(C' if set, else \*(C`HTTPS_PROXY\*(C'.
"-no_proxy addresses" 4
Item "-no_proxy addresses" List of \s-1IP\s0 addresses and/or \s-1DNS\s0 names of servers not to use an \s-1HTTP\s0(S) proxy for, separated by commas and/or whitespace (where in the latter case the whole argument must be enclosed in \*(L"...\*(R"). Default is from the environment variable \*(C`no_proxy\*(C' if set, else \*(C`NO_PROXY\*(C'.
"-header name=value" 4
Item "-header name=value" Adds the header name with the specified value to the \s-1OCSP\s0 request that is sent to the responder. This may be repeated.
"-timeout seconds" 4
Item "-timeout seconds" Connection timeout to the \s-1OCSP\s0 responder in seconds. On \s-1POSIX\s0 systems, when running as an \s-1OCSP\s0 responder, this option also limits the time that the responder is willing to wait for the client request. This time is measured from the time the responder accepts the connection until the complete request is received.
"-verify_other file" 4
Item "-verify_other file" File or \s-1URI\s0 containing additional certificates to search when attempting to locate the \s-1OCSP\s0 response signing certificate. Some responders omit the actual signer's certificate from the response: this option can be used to supply the necessary certificate in such cases. The input can be in \s-1PEM, DER,\s0 or PKCS#12 format.
"-trust_other" 4
Item "-trust_other" The certificates specified by the -verify_other option should be explicitly trusted and no additional checks will be performed on them. This is useful when the complete responder certificate chain is not available or trusting a root \s-1CA\s0 is not appropriate.
"-VAfile file" 4
Item "-VAfile file" File or \s-1URI\s0 containing explicitly trusted responder certificates. Equivalent to the -verify_other and -trust_other options. The input can be in \s-1PEM, DER,\s0 or PKCS#12 format.
"-noverify" 4
Item "-noverify" Don't attempt to verify the \s-1OCSP\s0 response signature or the nonce values. This option will normally only be used for debugging since it disables all verification of the responders certificate.
"-no_intern" 4
Item "-no_intern" Ignore certificates contained in the \s-1OCSP\s0 response when searching for the signers certificate. With this option the signers certificate must be specified with either the -verify_other or -VAfile options.
"-no_signature_verify" 4
Item "-no_signature_verify" Don't check the signature on the \s-1OCSP\s0 response. Since this option tolerates invalid signatures on \s-1OCSP\s0 responses it will normally only be used for testing purposes.
"-no_cert_verify" 4
Item "-no_cert_verify" Don't verify the \s-1OCSP\s0 response signers certificate at all. Since this option allows the \s-1OCSP\s0 response to be signed by any certificate it should only be used for testing purposes.
"-no_chain" 4
Item "-no_chain" Do not use certificates in the response as additional untrusted \s-1CA\s0 certificates.
"-no_explicit" 4
Item "-no_explicit" Do not explicitly trust the root \s-1CA\s0 if it is set to be trusted for \s-1OCSP\s0 signing.
"-no_cert_checks" 4
Item "-no_cert_checks" Don't perform any additional checks on the \s-1OCSP\s0 response signers certificate. That is do not make any checks to see if the signers certificate is authorised to provide the necessary status information: as a result this option should only be used for testing purposes.
"-validity_period nsec, -status_age age" 4
Item "-validity_period nsec, -status_age age" These options specify the range of times, in seconds, which will be tolerated in an \s-1OCSP\s0 response. Each certificate status response includes a notBefore time and an optional notAfter time. The current time should fall between these two values, but the interval between the two times may be only a few seconds. In practice the \s-1OCSP\s0 responder and clients clocks may not be precisely synchronised and so such a check may fail. To avoid this the \fB-validity_period option can be used to specify an acceptable error range in seconds, the default value is 5 minutes. .Sp If the notAfter time is omitted from a response then this means that new status information is immediately available. In this case the age of the \fBnotBefore field is checked to see it is not older than age seconds old. By default this additional check is not performed.
"-rcid digest" 4
Item "-rcid digest" This option sets the digest algorithm to use for certificate identification in the \s-1OCSP\s0 response. Any digest supported by the openssl-dgst\|(1) command can be used. The default is the same digest algorithm used in the request.
"-\f(BIdigest" 4
Item "-digest" This option sets digest algorithm to use for certificate identification in the \s-1OCSP\s0 request. Any digest supported by the OpenSSL dgst command can be used. The default is \s-1SHA-1.\s0 This option may be used multiple times to specify the digest used by subsequent certificate identifiers.
"-CAfile file, -no-CAfile, -CApath dir, -no-CApath, -CAstore uri, -no-CAstore" 4
Item "-CAfile file, -no-CAfile, -CApath dir, -no-CApath, -CAstore uri, -no-CAstore" See \*(L"Trusted Certificate Options\*(R" in openssl-verification-options\|(1) for details.
"-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" 4
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" Set various options of certificate chain verification. See \*(L"Verification Options\*(R" in openssl-verification-options\|(1) for details.
"-provider name" 4
Item "-provider name"

0

"-provider-path path" 4
Item "-provider-path path"
"-propquery propq" 4
Item "-propquery propq"

See \*(L"Provider Options\*(R" in openssl\|(1), provider\|(7), and property\|(7).

"\s-1OCSP\s0 Server Options"
Subsection "OCSP Server Options"
"-index indexfile" 4
Item "-index indexfile" The indexfile parameter is the name of a text index file in ca format containing certificate revocation information. .Sp If the -index option is specified then this command switches to responder mode, otherwise it is in client mode. The request(s) the responder processes can be either specified on the command line (using -issuer and -serial options), supplied in a file (using the -reqin option) or via external \s-1OCSP\s0 clients (if -port or -url is specified). .Sp If the -index option is present then the -CA and -rsigner options must also be present.
"-CA file" 4
Item "-CA file" \s-1CA\s0 certificate corresponding to the revocation information in the index file given with -index. The input can be in \s-1PEM, DER,\s0 or PKCS#12 format.
"-rsigner file" 4
Item "-rsigner file" The certificate to sign \s-1OCSP\s0 responses with.
"-rkey file" 4
Item "-rkey file" The private key to sign \s-1OCSP\s0 responses with: if not present the file specified in the -rsigner option is used.
"-passin arg" 4
Item "-passin arg" The private key password source. For more information about the format of arg see openssl-passphrase-options\|(1).
"-rother file" 4
Item "-rother file" Additional certificates to include in the \s-1OCSP\s0 response. The input can be in \s-1PEM, DER,\s0 or PKCS#12 format.
"-rsigopt nm:v" 4
Item "-rsigopt nm:v" Pass options to the signature algorithm when signing \s-1OCSP\s0 responses. Names and values of these options are algorithm-specific.
"-rmd digest" 4
Item "-rmd digest" The digest to use when signing the response.
"-badsig" 4
Item "-badsig" Corrupt the response signature before writing it; this can be useful for testing.
"-resp_no_certs" 4
Item "-resp_no_certs" Don't include any certificates in the \s-1OCSP\s0 response.
"-resp_key_id" 4
Item "-resp_key_id" Identify the signer certificate using the key \s-1ID,\s0 default is to use the subject name.
"-port portnum" 4
Item "-port portnum" Port to listen for \s-1OCSP\s0 requests on. The port may also be specified using the url option. A 0 argument indicates that any available port shall be chosen automatically.
"-ignore_err" 4
Item "-ignore_err" Ignore malformed requests or responses: When acting as an \s-1OCSP\s0 client, retry if a malformed response is received. When acting as an \s-1OCSP\s0 responder, continue running instead of terminating upon receiving a malformed request.
"-nrequest number" 4
Item "-nrequest number" The \s-1OCSP\s0 server will exit after receiving number requests, default unlimited.
"-multi process-count" 4
Item "-multi process-count" Run the specified number of \s-1OCSP\s0 responder child processes, with the parent process respawning child processes as needed. Child processes will detect changes in the \s-1CA\s0 index file and automatically reload it. When running as a responder -timeout option is recommended to limit the time each child is willing to wait for the client's \s-1OCSP\s0 response. This option is available on \s-1POSIX\s0 systems (that support the fork() and other required unix system-calls).
"-nmin minutes, -ndays days" 4
Item "-nmin minutes, -ndays days" Number of minutes or days when fresh revocation information is available: used in the nextUpdate field. If neither option is present then the \fBnextUpdate field is omitted meaning fresh revocation information is immediately available.
"OCSP RESPONSE VERIFICATION"
Header "OCSP RESPONSE VERIFICATION" \s-1OCSP\s0 Response follows the rules specified in \s-1RFC2560.\s0

Initially the \s-1OCSP\s0 responder certificate is located and the signature on the \s-1OCSP\s0 request checked using the responder certificate's public key.

Then a normal certificate verify is performed on the \s-1OCSP\s0 responder certificate building up a certificate chain in the process. The locations of the trusted certificates used to build the chain can be specified by the -CAfile, \fB-CApath or -CAstore options or they will be looked for in the standard OpenSSL certificates directory.

If the initial verify fails then the \s-1OCSP\s0 verify process halts with an error.

Otherwise the issuing \s-1CA\s0 certificate in the request is compared to the \s-1OCSP\s0 responder certificate: if there is a match then the \s-1OCSP\s0 verify succeeds.

Otherwise the \s-1OCSP\s0 responder certificate's \s-1CA\s0 is checked against the issuing \s-1CA\s0 certificate in the request. If there is a match and the OCSPSigning extended key usage is present in the \s-1OCSP\s0 responder certificate then the \s-1OCSP\s0 verify succeeds.

Otherwise, if -no_explicit is not set the root \s-1CA\s0 of the \s-1OCSP\s0 responders \s-1CA\s0 is checked to see if it is trusted for \s-1OCSP\s0 signing. If it is the \s-1OCSP\s0 verify succeeds.

If none of these checks is successful then the \s-1OCSP\s0 verify fails.

What this effectively means if that if the \s-1OCSP\s0 responder certificate is authorised directly by the \s-1CA\s0 it is issuing revocation information about (and it is correctly configured) then verification will succeed.

If the \s-1OCSP\s0 responder is a \*(L"global responder\*(R" which can give details about multiple CAs and has its own separate certificate chain then its root \s-1CA\s0 can be trusted for \s-1OCSP\s0 signing. For example:

.Vb 1 openssl x509 -in ocspCA.pem -addtrust OCSPSigning -out trustedCA.pem .Ve

Alternatively the responder certificate itself can be explicitly trusted with the -VAfile option.

"NOTES"
Header "NOTES" As noted, most of the verify options are for testing or debugging purposes. Normally only the -CApath, -CAfile, -CAstore and (if the responder is a 'global \s-1VA\s0') -VAfile options need to be used.

The \s-1OCSP\s0 server is only useful for test and demonstration purposes: it is not really usable as a full \s-1OCSP\s0 responder. It contains only a very simple \s-1HTTP\s0 request handling and can only handle the \s-1POST\s0 form of \s-1OCSP\s0 queries. It also handles requests serially meaning it cannot respond to new requests until it has processed the current one. The text index file format of revocation is also inefficient for large quantities of revocation data.

It is possible to run this command in responder mode via a \s-1CGI\s0 script using the -reqin and -respout options.

"EXAMPLES"
Header "EXAMPLES" Create an \s-1OCSP\s0 request and write it to a file:

.Vb 1 openssl ocsp -issuer issuer.pem -cert c1.pem -cert c2.pem -reqout req.der .Ve

Send a query to an \s-1OCSP\s0 responder with \s-1URL\s0 http://ocsp.myhost.com/ save the response to a file, print it out in text form, and verify the response:

.Vb 2 openssl ocsp -issuer issuer.pem -cert c1.pem -cert c2.pem \e -url http://ocsp.myhost.com/ -resp_text -respout resp.der .Ve

Read in an \s-1OCSP\s0 response and print out text form:

.Vb 1 openssl ocsp -respin resp.der -text -noverify .Ve

\s-1OCSP\s0 server on port 8888 using a standard ca configuration, and a separate responder certificate. All requests and responses are printed to a file.

.Vb 2 openssl ocsp -index demoCA/index.txt -port 8888 -rsigner rcert.pem -CA demoCA/cacert.pem -text -out log.txt .Ve

As above but exit after processing one request:

.Vb 2 openssl ocsp -index demoCA/index.txt -port 8888 -rsigner rcert.pem -CA demoCA/cacert.pem -nrequest 1 .Ve

Query status information using an internally generated request:

.Vb 2 openssl ocsp -index demoCA/index.txt -rsigner rcert.pem -CA demoCA/cacert.pem -issuer demoCA/cacert.pem -serial 1 .Ve

Query status information using request read from a file, and write the response to a second file.

.Vb 2 openssl ocsp -index demoCA/index.txt -rsigner rcert.pem -CA demoCA/cacert.pem -reqin req.der -respout resp.der .Ve

"HISTORY"
Header "HISTORY" The -no_alt_chains option was added in OpenSSL 1.1.0.
"COPYRIGHT"
Header "COPYRIGHT" Copyright 2001-2021 The OpenSSL Project Authors. All Rights Reserved.

Licensed under the Apache License 2.0 (the \*(L"License\*(R"). You may not use this file except in compliance with the License. You can obtain a copy in the file \s-1LICENSE\s0 in the source distribution or at <https://www.openssl.org/source/license.html>.