1b077aed3SPierre Pronchery=pod 2b077aed3SPierre Pronchery{- OpenSSL::safe::output_do_not_edit_headers(); -} 3b077aed3SPierre Pronchery 4b077aed3SPierre Pronchery=head1 NAME 5b077aed3SPierre Pronchery 6b077aed3SPierre Proncheryopenssl-ocsp - Online Certificate Status Protocol command 7b077aed3SPierre Pronchery 8b077aed3SPierre Pronchery=head1 SYNOPSIS 9b077aed3SPierre Pronchery 10b077aed3SPierre Pronchery=head2 OCSP Client 11b077aed3SPierre Pronchery 12b077aed3SPierre ProncheryB<openssl> B<ocsp> 13b077aed3SPierre Pronchery[B<-help>] 14b077aed3SPierre Pronchery[B<-out> I<file>] 15b077aed3SPierre Pronchery[B<-issuer> I<file>] 16b077aed3SPierre Pronchery[B<-cert> I<file>] 17b077aed3SPierre Pronchery[B<-no_certs>] 18b077aed3SPierre Pronchery[B<-serial> I<n>] 19b077aed3SPierre Pronchery[B<-signer> I<file>] 20b077aed3SPierre Pronchery[B<-signkey> I<file>] 21b077aed3SPierre Pronchery[B<-sign_other> I<file>] 22b077aed3SPierre Pronchery[B<-nonce>] 23b077aed3SPierre Pronchery[B<-no_nonce>] 24b077aed3SPierre Pronchery[B<-req_text>] 25b077aed3SPierre Pronchery[B<-resp_text>] 26b077aed3SPierre Pronchery[B<-text>] 27b077aed3SPierre Pronchery[B<-reqout> I<file>] 28b077aed3SPierre Pronchery[B<-respout> I<file>] 29b077aed3SPierre Pronchery[B<-reqin> I<file>] 30b077aed3SPierre Pronchery[B<-respin> I<file>] 31b077aed3SPierre Pronchery[B<-url> I<URL>] 32b077aed3SPierre Pronchery[B<-host> I<host>:I<port>] 33*0d0c8621SEnji Cooper[B<-path> I<pathname>] 34*0d0c8621SEnji Cooper[B<-proxy> I<[http[s]://][userinfo@]host[:port][/path][?query][#fragment]>] 35b077aed3SPierre Pronchery[B<-no_proxy> I<addresses>] 36b077aed3SPierre Pronchery[B<-header>] 37b077aed3SPierre Pronchery[B<-timeout> I<seconds>] 38b077aed3SPierre Pronchery[B<-VAfile> I<file>] 39b077aed3SPierre Pronchery[B<-validity_period> I<n>] 40b077aed3SPierre Pronchery[B<-status_age> I<n>] 41b077aed3SPierre Pronchery[B<-noverify>] 42b077aed3SPierre Pronchery[B<-verify_other> I<file>] 43b077aed3SPierre Pronchery[B<-trust_other>] 44b077aed3SPierre Pronchery[B<-no_intern>] 45b077aed3SPierre Pronchery[B<-no_signature_verify>] 46b077aed3SPierre Pronchery[B<-no_cert_verify>] 47b077aed3SPierre Pronchery[B<-no_chain>] 48b077aed3SPierre Pronchery[B<-no_cert_checks>] 49b077aed3SPierre Pronchery[B<-no_explicit>] 50b077aed3SPierre Pronchery[B<-port> I<num>] 51b077aed3SPierre Pronchery[B<-ignore_err>] 52b077aed3SPierre Pronchery 53b077aed3SPierre Pronchery=head2 OCSP Server 54b077aed3SPierre Pronchery 55b077aed3SPierre ProncheryB<openssl> B<ocsp> 56b077aed3SPierre Pronchery[B<-index> I<file>] 57b077aed3SPierre Pronchery[B<-CA> I<file>] 58b077aed3SPierre Pronchery[B<-rsigner> I<file>] 59b077aed3SPierre Pronchery[B<-rkey> I<file>] 60b077aed3SPierre Pronchery[B<-passin> I<arg>] 61b077aed3SPierre Pronchery[B<-rother> I<file>] 62b077aed3SPierre Pronchery[B<-rsigopt> I<nm>:I<v>] 63b077aed3SPierre Pronchery[B<-rmd> I<digest>] 64b077aed3SPierre Pronchery[B<-badsig>] 65b077aed3SPierre Pronchery[B<-resp_no_certs>] 66b077aed3SPierre Pronchery[B<-nmin> I<n>] 67b077aed3SPierre Pronchery[B<-ndays> I<n>] 68b077aed3SPierre Pronchery[B<-resp_key_id>] 69b077aed3SPierre Pronchery[B<-nrequest> I<n>] 70b077aed3SPierre Pronchery[B<-multi> I<process-count>] 71b077aed3SPierre Pronchery[B<-rcid> I<digest>] 72b077aed3SPierre Pronchery[B<-I<digest>>] 73b077aed3SPierre Pronchery{- $OpenSSL::safe::opt_trust_synopsis -} 74b077aed3SPierre Pronchery{- $OpenSSL::safe::opt_v_synopsis -} 75b077aed3SPierre Pronchery{- $OpenSSL::safe::opt_provider_synopsis -} 76b077aed3SPierre Pronchery 77b077aed3SPierre Pronchery=head1 DESCRIPTION 78b077aed3SPierre Pronchery 79b077aed3SPierre ProncheryThe Online Certificate Status Protocol (OCSP) enables applications to 80b077aed3SPierre Proncherydetermine the (revocation) state of an identified certificate (RFC 2560). 81b077aed3SPierre Pronchery 82b077aed3SPierre ProncheryThis command performs many common OCSP tasks. It can be used 83b077aed3SPierre Proncheryto print out requests and responses, create requests and send queries 84b077aed3SPierre Proncheryto an OCSP responder and behave like a mini OCSP server itself. 85b077aed3SPierre Pronchery 86b077aed3SPierre Pronchery=head1 OPTIONS 87b077aed3SPierre Pronchery 88b077aed3SPierre ProncheryThis command operates as either a client or a server. 89b077aed3SPierre ProncheryThe options are described below, divided into those two modes. 90b077aed3SPierre Pronchery 91b077aed3SPierre Pronchery=head2 OCSP Client Options 92b077aed3SPierre Pronchery 93b077aed3SPierre Pronchery=over 4 94b077aed3SPierre Pronchery 95b077aed3SPierre Pronchery=item B<-help> 96b077aed3SPierre Pronchery 97b077aed3SPierre ProncheryPrint out a usage message. 98b077aed3SPierre Pronchery 99b077aed3SPierre Pronchery=item B<-out> I<filename> 100b077aed3SPierre Pronchery 101b077aed3SPierre Proncheryspecify output filename, default is standard output. 102b077aed3SPierre Pronchery 103b077aed3SPierre Pronchery=item B<-issuer> I<filename> 104b077aed3SPierre Pronchery 105b077aed3SPierre ProncheryThis specifies the current issuer certificate. This option can be used 106b077aed3SPierre Proncherymultiple times. 107b077aed3SPierre ProncheryThis option B<MUST> come before any B<-cert> options. 108b077aed3SPierre Pronchery 109b077aed3SPierre Pronchery=item B<-cert> I<filename> 110b077aed3SPierre Pronchery 111b077aed3SPierre ProncheryAdd the certificate I<filename> to the request. The issuer certificate 112b077aed3SPierre Proncheryis taken from the previous B<-issuer> option, or an error occurs if no 113b077aed3SPierre Proncheryissuer certificate is specified. 114b077aed3SPierre Pronchery 115b077aed3SPierre Pronchery=item B<-no_certs> 116b077aed3SPierre Pronchery 117b077aed3SPierre ProncheryDon't include any certificates in signed request. 118b077aed3SPierre Pronchery 119b077aed3SPierre Pronchery=item B<-serial> I<num> 120b077aed3SPierre Pronchery 121b077aed3SPierre ProncherySame as the B<-cert> option except the certificate with serial number 122b077aed3SPierre ProncheryB<num> is added to the request. The serial number is interpreted as a 123b077aed3SPierre Proncherydecimal integer unless preceded by C<0x>. Negative integers can also 124b077aed3SPierre Proncherybe specified by preceding the value by a C<-> sign. 125b077aed3SPierre Pronchery 126b077aed3SPierre Pronchery=item B<-signer> I<filename>, B<-signkey> I<filename> 127b077aed3SPierre Pronchery 128b077aed3SPierre ProncherySign the OCSP request using the certificate specified in the B<-signer> 129b077aed3SPierre Proncheryoption and the private key specified by the B<-signkey> option. If 130b077aed3SPierre Proncherythe B<-signkey> option is not present then the private key is read 131b077aed3SPierre Proncheryfrom the same file as the certificate. If neither option is specified then 132b077aed3SPierre Proncherythe OCSP request is not signed. 133b077aed3SPierre Pronchery 134b077aed3SPierre Pronchery=item B<-sign_other> I<filename> 135b077aed3SPierre Pronchery 136b077aed3SPierre ProncheryAdditional certificates to include in the signed request. 137b077aed3SPierre ProncheryThe input can be in PEM, DER, or PKCS#12 format. 138b077aed3SPierre Pronchery 139b077aed3SPierre Pronchery=item B<-nonce>, B<-no_nonce> 140b077aed3SPierre Pronchery 141b077aed3SPierre ProncheryAdd an OCSP nonce extension to a request or disable OCSP nonce addition. 142b077aed3SPierre ProncheryNormally if an OCSP request is input using the B<-reqin> option no 143b077aed3SPierre Proncherynonce is added: using the B<-nonce> option will force addition of a nonce. 144b077aed3SPierre ProncheryIf an OCSP request is being created (using B<-cert> and B<-serial> options) 145b077aed3SPierre Proncherya nonce is automatically added specifying B<-no_nonce> overrides this. 146b077aed3SPierre Pronchery 147b077aed3SPierre Pronchery=item B<-req_text>, B<-resp_text>, B<-text> 148b077aed3SPierre Pronchery 149b077aed3SPierre ProncheryPrint out the text form of the OCSP request, response or both respectively. 150b077aed3SPierre Pronchery 151b077aed3SPierre Pronchery=item B<-reqout> I<file>, B<-respout> I<file> 152b077aed3SPierre Pronchery 153b077aed3SPierre ProncheryWrite out the DER encoded certificate request or response to I<file>. 154b077aed3SPierre Pronchery 155b077aed3SPierre Pronchery=item B<-reqin> I<file>, B<-respin> I<file> 156b077aed3SPierre Pronchery 157b077aed3SPierre ProncheryRead OCSP request or response file from I<file>. These option are ignored 158b077aed3SPierre Proncheryif OCSP request or response creation is implied by other options (for example 159b077aed3SPierre Proncherywith B<-serial>, B<-cert> and B<-host> options). 160b077aed3SPierre Pronchery 161b077aed3SPierre Pronchery=item B<-url> I<responder_url> 162b077aed3SPierre Pronchery 163*0d0c8621SEnji CooperSpecify the responder host and optionally port and path via a URL. 164*0d0c8621SEnji CooperBoth HTTP and HTTPS (SSL/TLS) URLs can be specified. 165b077aed3SPierre ProncheryThe optional userinfo and fragment components are ignored. 166b077aed3SPierre ProncheryAny given query component is handled as part of the path component. 167*0d0c8621SEnji CooperFor details, see the B<-host> and B<-path> options described next. 168b077aed3SPierre Pronchery 169*0d0c8621SEnji Cooper=item B<-host> I<host>:I<port>, B<-path> I<pathname> 170b077aed3SPierre Pronchery 171b077aed3SPierre ProncheryIf the B<-host> option is present then the OCSP request is sent to the host 172*0d0c8621SEnji CooperI<host> on port I<port>. 173*0d0c8621SEnji CooperThe I<host> may be a domain name or an IP (v4 or v6) address, 174*0d0c8621SEnji Coopersuch as C<127.0.0.1> or C<[::1]> for localhost. 175*0d0c8621SEnji CooperIf it is an IPv6 address, it must be enclosed in C<[> and C<]>. 176b077aed3SPierre Pronchery 177*0d0c8621SEnji CooperThe B<-path> option specifies the HTTP pathname to use or "/" by default. 178*0d0c8621SEnji CooperThis is equivalent to specifying B<-url> with scheme 179*0d0c8621SEnji Cooperhttp:// and the given I<host>, I<port>, and optional I<pathname>. 180*0d0c8621SEnji Cooper 181*0d0c8621SEnji Cooper=item B<-proxy> I<[http[s]://][userinfo@]host[:port][/path][?query][#fragment]> 182b077aed3SPierre Pronchery 183b077aed3SPierre ProncheryThe HTTP(S) proxy server to use for reaching the OCSP server unless B<-no_proxy> 184b077aed3SPierre Proncheryapplies, see below. 185*0d0c8621SEnji CooperIf the host string is an IPv6 address, it must be enclosed in C<[> and C<]>. 186b077aed3SPierre ProncheryThe proxy port defaults to 80 or 443 if the scheme is C<https>; apart from that 187b077aed3SPierre Proncherythe optional C<http://> or C<https://> prefix is ignored, 188*0d0c8621SEnji Cooperas well as any userinfo, path, query, and fragment components. 189b077aed3SPierre ProncheryDefaults to the environment variable C<http_proxy> if set, else C<HTTP_PROXY> 190b077aed3SPierre Proncheryin case no TLS is used, otherwise C<https_proxy> if set, else C<HTTPS_PROXY>. 191b077aed3SPierre Pronchery 192b077aed3SPierre Pronchery=item B<-no_proxy> I<addresses> 193b077aed3SPierre Pronchery 194b077aed3SPierre ProncheryList of IP addresses and/or DNS names of servers 195b077aed3SPierre Proncherynot to use an HTTP(S) proxy for, separated by commas and/or whitespace 196b077aed3SPierre Pronchery(where in the latter case the whole argument must be enclosed in "..."). 197b077aed3SPierre ProncheryDefault is from the environment variable C<no_proxy> if set, else C<NO_PROXY>. 198b077aed3SPierre Pronchery 199b077aed3SPierre Pronchery=item B<-header> I<name>=I<value> 200b077aed3SPierre Pronchery 201b077aed3SPierre ProncheryAdds the header I<name> with the specified I<value> to the OCSP request 202b077aed3SPierre Proncherythat is sent to the responder. 203b077aed3SPierre ProncheryThis may be repeated. 204b077aed3SPierre Pronchery 205b077aed3SPierre Pronchery=item B<-timeout> I<seconds> 206b077aed3SPierre Pronchery 207b077aed3SPierre ProncheryConnection timeout to the OCSP responder in seconds. 208b077aed3SPierre ProncheryOn POSIX systems, when running as an OCSP responder, this option also limits 209b077aed3SPierre Proncherythe time that the responder is willing to wait for the client request. 210b077aed3SPierre ProncheryThis time is measured from the time the responder accepts the connection until 211b077aed3SPierre Proncherythe complete request is received. 212b077aed3SPierre Pronchery 213b077aed3SPierre Pronchery=item B<-verify_other> I<file> 214b077aed3SPierre Pronchery 215b077aed3SPierre ProncheryFile or URI containing additional certificates to search 216b077aed3SPierre Proncherywhen attempting to locate 217b077aed3SPierre Proncherythe OCSP response signing certificate. Some responders omit the actual signer's 218b077aed3SPierre Proncherycertificate from the response: this option can be used to supply the necessary 219b077aed3SPierre Proncherycertificate in such cases. 220b077aed3SPierre ProncheryThe input can be in PEM, DER, or PKCS#12 format. 221b077aed3SPierre Pronchery 222b077aed3SPierre Pronchery=item B<-trust_other> 223b077aed3SPierre Pronchery 224b077aed3SPierre ProncheryThe certificates specified by the B<-verify_other> option should be explicitly 225b077aed3SPierre Proncherytrusted and no additional checks will be performed on them. This is useful 226b077aed3SPierre Proncherywhen the complete responder certificate chain is not available or trusting a 227b077aed3SPierre Proncheryroot CA is not appropriate. 228b077aed3SPierre Pronchery 229b077aed3SPierre Pronchery=item B<-VAfile> I<file> 230b077aed3SPierre Pronchery 231b077aed3SPierre ProncheryFile or URI containing explicitly trusted responder certificates. 232b077aed3SPierre ProncheryEquivalent to the B<-verify_other> and B<-trust_other> options. 233b077aed3SPierre ProncheryThe input can be in PEM, DER, or PKCS#12 format. 234b077aed3SPierre Pronchery 235b077aed3SPierre Pronchery=item B<-noverify> 236b077aed3SPierre Pronchery 237b077aed3SPierre ProncheryDon't attempt to verify the OCSP response signature or the nonce 238b077aed3SPierre Proncheryvalues. This option will normally only be used for debugging since it 239b077aed3SPierre Proncherydisables all verification of the responders certificate. 240b077aed3SPierre Pronchery 241b077aed3SPierre Pronchery=item B<-no_intern> 242b077aed3SPierre Pronchery 243b077aed3SPierre ProncheryIgnore certificates contained in the OCSP response when searching for the 244b077aed3SPierre Proncherysigners certificate. With this option the signers certificate must be specified 245b077aed3SPierre Proncherywith either the B<-verify_other> or B<-VAfile> options. 246b077aed3SPierre Pronchery 247b077aed3SPierre Pronchery=item B<-no_signature_verify> 248b077aed3SPierre Pronchery 249b077aed3SPierre ProncheryDon't check the signature on the OCSP response. Since this option 250b077aed3SPierre Proncherytolerates invalid signatures on OCSP responses it will normally only be 251b077aed3SPierre Proncheryused for testing purposes. 252b077aed3SPierre Pronchery 253b077aed3SPierre Pronchery=item B<-no_cert_verify> 254b077aed3SPierre Pronchery 255b077aed3SPierre ProncheryDon't verify the OCSP response signers certificate at all. Since this 256b077aed3SPierre Proncheryoption allows the OCSP response to be signed by any certificate it should 257b077aed3SPierre Proncheryonly be used for testing purposes. 258b077aed3SPierre Pronchery 259b077aed3SPierre Pronchery=item B<-no_chain> 260b077aed3SPierre Pronchery 261b077aed3SPierre ProncheryDo not use certificates in the response as additional untrusted CA 262b077aed3SPierre Proncherycertificates. 263b077aed3SPierre Pronchery 264b077aed3SPierre Pronchery=item B<-no_explicit> 265b077aed3SPierre Pronchery 266b077aed3SPierre ProncheryDo not explicitly trust the root CA if it is set to be trusted for OCSP signing. 267b077aed3SPierre Pronchery 268b077aed3SPierre Pronchery=item B<-no_cert_checks> 269b077aed3SPierre Pronchery 270b077aed3SPierre ProncheryDon't perform any additional checks on the OCSP response signers certificate. 271b077aed3SPierre ProncheryThat is do not make any checks to see if the signers certificate is authorised 272b077aed3SPierre Proncheryto provide the necessary status information: as a result this option should 273b077aed3SPierre Proncheryonly be used for testing purposes. 274b077aed3SPierre Pronchery 275b077aed3SPierre Pronchery=item B<-validity_period> I<nsec>, B<-status_age> I<age> 276b077aed3SPierre Pronchery 277b077aed3SPierre ProncheryThese options specify the range of times, in seconds, which will be tolerated 278b077aed3SPierre Proncheryin an OCSP response. Each certificate status response includes a B<notBefore> 279b077aed3SPierre Proncherytime and an optional B<notAfter> time. The current time should fall between 280b077aed3SPierre Proncherythese two values, but the interval between the two times may be only a few 281b077aed3SPierre Proncheryseconds. In practice the OCSP responder and clients clocks may not be precisely 282b077aed3SPierre Proncherysynchronised and so such a check may fail. To avoid this the 283b077aed3SPierre ProncheryB<-validity_period> option can be used to specify an acceptable error range in 284b077aed3SPierre Proncheryseconds, the default value is 5 minutes. 285b077aed3SPierre Pronchery 286b077aed3SPierre ProncheryIf the B<notAfter> time is omitted from a response then this means that new 287b077aed3SPierre Proncherystatus information is immediately available. In this case the age of the 288b077aed3SPierre ProncheryB<notBefore> field is checked to see it is not older than I<age> seconds old. 289b077aed3SPierre ProncheryBy default this additional check is not performed. 290b077aed3SPierre Pronchery 291b077aed3SPierre Pronchery=item B<-rcid> I<digest> 292b077aed3SPierre Pronchery 293b077aed3SPierre ProncheryThis option sets the digest algorithm to use for certificate identification 294b077aed3SPierre Proncheryin the OCSP response. Any digest supported by the L<openssl-dgst(1)> command can 295b077aed3SPierre Proncherybe used. The default is the same digest algorithm used in the request. 296b077aed3SPierre Pronchery 297b077aed3SPierre Pronchery=item B<-I<digest>> 298b077aed3SPierre Pronchery 299b077aed3SPierre ProncheryThis option sets digest algorithm to use for certificate identification in the 300b077aed3SPierre ProncheryOCSP request. Any digest supported by the OpenSSL B<dgst> command can be used. 301b077aed3SPierre ProncheryThe default is SHA-1. This option may be used multiple times to specify the 302b077aed3SPierre Proncherydigest used by subsequent certificate identifiers. 303b077aed3SPierre Pronchery 304b077aed3SPierre Pronchery{- $OpenSSL::safe::opt_trust_item -} 305b077aed3SPierre Pronchery 306b077aed3SPierre Pronchery{- $OpenSSL::safe::opt_v_item -} 307b077aed3SPierre Pronchery 308b077aed3SPierre Pronchery{- $OpenSSL::safe::opt_provider_item -} 309b077aed3SPierre Pronchery 310b077aed3SPierre Pronchery=back 311b077aed3SPierre Pronchery 312b077aed3SPierre Pronchery=head2 OCSP Server Options 313b077aed3SPierre Pronchery 314b077aed3SPierre Pronchery=over 4 315b077aed3SPierre Pronchery 316b077aed3SPierre Pronchery=item B<-index> I<indexfile> 317b077aed3SPierre Pronchery 318b077aed3SPierre ProncheryThe I<indexfile> parameter is the name of a text index file in B<ca> 319b077aed3SPierre Proncheryformat containing certificate revocation information. 320b077aed3SPierre Pronchery 321b077aed3SPierre ProncheryIf the B<-index> option is specified then this command switches to 322b077aed3SPierre Proncheryresponder mode, otherwise it is in client mode. The request(s) the responder 323b077aed3SPierre Proncheryprocesses can be either specified on the command line (using B<-issuer> 324b077aed3SPierre Proncheryand B<-serial> options), supplied in a file (using the B<-reqin> option) 325b077aed3SPierre Proncheryor via external OCSP clients (if B<-port> or B<-url> is specified). 326b077aed3SPierre Pronchery 327b077aed3SPierre ProncheryIf the B<-index> option is present then the B<-CA> and B<-rsigner> options 328b077aed3SPierre Proncherymust also be present. 329b077aed3SPierre Pronchery 330b077aed3SPierre Pronchery=item B<-CA> I<file> 331b077aed3SPierre Pronchery 332b077aed3SPierre ProncheryCA certificate corresponding to the revocation information in the index 333b077aed3SPierre Proncheryfile given with B<-index>. 334b077aed3SPierre ProncheryThe input can be in PEM, DER, or PKCS#12 format. 335b077aed3SPierre Pronchery 336b077aed3SPierre Pronchery=item B<-rsigner> I<file> 337b077aed3SPierre Pronchery 338b077aed3SPierre ProncheryThe certificate to sign OCSP responses with. 339b077aed3SPierre Pronchery 340b077aed3SPierre Pronchery=item B<-rkey> I<file> 341b077aed3SPierre Pronchery 342b077aed3SPierre ProncheryThe private key to sign OCSP responses with: if not present the file 343b077aed3SPierre Proncheryspecified in the B<-rsigner> option is used. 344b077aed3SPierre Pronchery 345b077aed3SPierre Pronchery=item B<-passin> I<arg> 346b077aed3SPierre Pronchery 347b077aed3SPierre ProncheryThe private key password source. For more information about the format of I<arg> 348b077aed3SPierre Proncherysee L<openssl-passphrase-options(1)>. 349b077aed3SPierre Pronchery 350b077aed3SPierre Pronchery=item B<-rother> I<file> 351b077aed3SPierre Pronchery 352b077aed3SPierre ProncheryAdditional certificates to include in the OCSP response. 353b077aed3SPierre ProncheryThe input can be in PEM, DER, or PKCS#12 format. 354b077aed3SPierre Pronchery 355b077aed3SPierre Pronchery=item B<-rsigopt> I<nm>:I<v> 356b077aed3SPierre Pronchery 357b077aed3SPierre ProncheryPass options to the signature algorithm when signing OCSP responses. 358b077aed3SPierre ProncheryNames and values of these options are algorithm-specific. 359b077aed3SPierre Pronchery 360b077aed3SPierre Pronchery=item B<-rmd> I<digest> 361b077aed3SPierre Pronchery 362b077aed3SPierre ProncheryThe digest to use when signing the response. 363b077aed3SPierre Pronchery 364b077aed3SPierre Pronchery=item B<-badsig> 365b077aed3SPierre Pronchery 366b077aed3SPierre ProncheryCorrupt the response signature before writing it; this can be useful 367b077aed3SPierre Proncheryfor testing. 368b077aed3SPierre Pronchery 369b077aed3SPierre Pronchery=item B<-resp_no_certs> 370b077aed3SPierre Pronchery 371b077aed3SPierre ProncheryDon't include any certificates in the OCSP response. 372b077aed3SPierre Pronchery 373b077aed3SPierre Pronchery=item B<-resp_key_id> 374b077aed3SPierre Pronchery 375b077aed3SPierre ProncheryIdentify the signer certificate using the key ID, default is to use the 376b077aed3SPierre Proncherysubject name. 377b077aed3SPierre Pronchery 378b077aed3SPierre Pronchery=item B<-port> I<portnum> 379b077aed3SPierre Pronchery 380*0d0c8621SEnji CooperPort to listen for OCSP requests on. Both IPv4 and IPv6 are possible. 381*0d0c8621SEnji CooperThe port may also be specified using the B<-url> option. 382b077aed3SPierre ProncheryA C<0> argument indicates that any available port shall be chosen automatically. 383b077aed3SPierre Pronchery 384b077aed3SPierre Pronchery=item B<-ignore_err> 385b077aed3SPierre Pronchery 386b077aed3SPierre ProncheryIgnore malformed requests or responses: When acting as an OCSP client, retry if 387b077aed3SPierre Proncherya malformed response is received. When acting as an OCSP responder, continue 388b077aed3SPierre Proncheryrunning instead of terminating upon receiving a malformed request. 389b077aed3SPierre Pronchery 390b077aed3SPierre Pronchery=item B<-nrequest> I<number> 391b077aed3SPierre Pronchery 392b077aed3SPierre ProncheryThe OCSP server will exit after receiving I<number> requests, default unlimited. 393b077aed3SPierre Pronchery 394b077aed3SPierre Pronchery=item B<-multi> I<process-count> 395b077aed3SPierre Pronchery 396b077aed3SPierre ProncheryRun the specified number of OCSP responder child processes, with the parent 397b077aed3SPierre Proncheryprocess respawning child processes as needed. 398b077aed3SPierre ProncheryChild processes will detect changes in the CA index file and automatically 399b077aed3SPierre Proncheryreload it. 400b077aed3SPierre ProncheryWhen running as a responder B<-timeout> option is recommended to limit the time 401b077aed3SPierre Proncheryeach child is willing to wait for the client's OCSP response. 402b077aed3SPierre ProncheryThis option is available on POSIX systems (that support the fork() and other 403b077aed3SPierre Proncheryrequired unix system-calls). 404b077aed3SPierre Pronchery 405b077aed3SPierre Pronchery=item B<-nmin> I<minutes>, B<-ndays> I<days> 406b077aed3SPierre Pronchery 407b077aed3SPierre ProncheryNumber of minutes or days when fresh revocation information is available: 408b077aed3SPierre Proncheryused in the B<nextUpdate> field. If neither option is present then the 409b077aed3SPierre ProncheryB<nextUpdate> field is omitted meaning fresh revocation information is 410b077aed3SPierre Proncheryimmediately available. 411b077aed3SPierre Pronchery 412b077aed3SPierre Pronchery=back 413b077aed3SPierre Pronchery 414b077aed3SPierre Pronchery=head1 OCSP RESPONSE VERIFICATION 415b077aed3SPierre Pronchery 416b077aed3SPierre ProncheryOCSP Response follows the rules specified in RFC2560. 417b077aed3SPierre Pronchery 418b077aed3SPierre ProncheryInitially the OCSP responder certificate is located and the signature on 419b077aed3SPierre Proncherythe OCSP request checked using the responder certificate's public key. 420b077aed3SPierre Pronchery 421b077aed3SPierre ProncheryThen a normal certificate verify is performed on the OCSP responder certificate 422b077aed3SPierre Proncherybuilding up a certificate chain in the process. The locations of the trusted 423b077aed3SPierre Proncherycertificates used to build the chain can be specified by the B<-CAfile>, 424b077aed3SPierre ProncheryB<-CApath> or B<-CAstore> options or they will be looked for in the 425b077aed3SPierre Proncherystandard OpenSSL certificates directory. 426b077aed3SPierre Pronchery 427b077aed3SPierre ProncheryIf the initial verify fails then the OCSP verify process halts with an 428b077aed3SPierre Proncheryerror. 429b077aed3SPierre Pronchery 430b077aed3SPierre ProncheryOtherwise the issuing CA certificate in the request is compared to the OCSP 431b077aed3SPierre Proncheryresponder certificate: if there is a match then the OCSP verify succeeds. 432b077aed3SPierre Pronchery 433b077aed3SPierre ProncheryOtherwise the OCSP responder certificate's CA is checked against the issuing 434b077aed3SPierre ProncheryCA certificate in the request. If there is a match and the OCSPSigning 435b077aed3SPierre Proncheryextended key usage is present in the OCSP responder certificate then the 436b077aed3SPierre ProncheryOCSP verify succeeds. 437b077aed3SPierre Pronchery 438b077aed3SPierre ProncheryOtherwise, if B<-no_explicit> is B<not> set the root CA of the OCSP responders 439b077aed3SPierre ProncheryCA is checked to see if it is trusted for OCSP signing. If it is the OCSP 440b077aed3SPierre Proncheryverify succeeds. 441b077aed3SPierre Pronchery 442b077aed3SPierre ProncheryIf none of these checks is successful then the OCSP verify fails. 443b077aed3SPierre Pronchery 444b077aed3SPierre ProncheryWhat this effectively means if that if the OCSP responder certificate is 445b077aed3SPierre Proncheryauthorised directly by the CA it is issuing revocation information about 446b077aed3SPierre Pronchery(and it is correctly configured) then verification will succeed. 447b077aed3SPierre Pronchery 448b077aed3SPierre ProncheryIf the OCSP responder is a "global responder" which can give details about 449b077aed3SPierre Proncherymultiple CAs and has its own separate certificate chain then its root 450b077aed3SPierre ProncheryCA can be trusted for OCSP signing. For example: 451b077aed3SPierre Pronchery 452b077aed3SPierre Pronchery openssl x509 -in ocspCA.pem -addtrust OCSPSigning -out trustedCA.pem 453b077aed3SPierre Pronchery 454b077aed3SPierre ProncheryAlternatively the responder certificate itself can be explicitly trusted 455b077aed3SPierre Proncherywith the B<-VAfile> option. 456b077aed3SPierre Pronchery 457b077aed3SPierre Pronchery=head1 NOTES 458b077aed3SPierre Pronchery 459b077aed3SPierre ProncheryAs noted, most of the verify options are for testing or debugging purposes. 460b077aed3SPierre ProncheryNormally only the B<-CApath>, B<-CAfile>, B<-CAstore> and (if the responder 461b077aed3SPierre Proncheryis a 'global VA') B<-VAfile> options need to be used. 462b077aed3SPierre Pronchery 463b077aed3SPierre ProncheryThe OCSP server is only useful for test and demonstration purposes: it is 464b077aed3SPierre Proncherynot really usable as a full OCSP responder. It contains only a very 465b077aed3SPierre Proncherysimple HTTP request handling and can only handle the POST form of OCSP 466b077aed3SPierre Proncheryqueries. It also handles requests serially meaning it cannot respond to 467b077aed3SPierre Proncherynew requests until it has processed the current one. The text index file 468b077aed3SPierre Proncheryformat of revocation is also inefficient for large quantities of revocation 469b077aed3SPierre Proncherydata. 470b077aed3SPierre Pronchery 471b077aed3SPierre ProncheryIt is possible to run this command in responder mode via a CGI 472b077aed3SPierre Proncheryscript using the B<-reqin> and B<-respout> options. 473b077aed3SPierre Pronchery 474b077aed3SPierre Pronchery=head1 EXAMPLES 475b077aed3SPierre Pronchery 476b077aed3SPierre ProncheryCreate an OCSP request and write it to a file: 477b077aed3SPierre Pronchery 478b077aed3SPierre Pronchery openssl ocsp -issuer issuer.pem -cert c1.pem -cert c2.pem -reqout req.der 479b077aed3SPierre Pronchery 480b077aed3SPierre ProncherySend a query to an OCSP responder with URL http://ocsp.myhost.com/ save the 481b077aed3SPierre Proncheryresponse to a file, print it out in text form, and verify the response: 482b077aed3SPierre Pronchery 483b077aed3SPierre Pronchery openssl ocsp -issuer issuer.pem -cert c1.pem -cert c2.pem \ 484b077aed3SPierre Pronchery -url http://ocsp.myhost.com/ -resp_text -respout resp.der 485b077aed3SPierre Pronchery 486b077aed3SPierre ProncheryRead in an OCSP response and print out text form: 487b077aed3SPierre Pronchery 488b077aed3SPierre Pronchery openssl ocsp -respin resp.der -text -noverify 489b077aed3SPierre Pronchery 490b077aed3SPierre ProncheryOCSP server on port 8888 using a standard B<ca> configuration, and a separate 491b077aed3SPierre Proncheryresponder certificate. All requests and responses are printed to a file. 492b077aed3SPierre Pronchery 493b077aed3SPierre Pronchery openssl ocsp -index demoCA/index.txt -port 8888 -rsigner rcert.pem -CA demoCA/cacert.pem 494b077aed3SPierre Pronchery -text -out log.txt 495b077aed3SPierre Pronchery 496b077aed3SPierre ProncheryAs above but exit after processing one request: 497b077aed3SPierre Pronchery 498b077aed3SPierre Pronchery openssl ocsp -index demoCA/index.txt -port 8888 -rsigner rcert.pem -CA demoCA/cacert.pem 499b077aed3SPierre Pronchery -nrequest 1 500b077aed3SPierre Pronchery 501b077aed3SPierre ProncheryQuery status information using an internally generated request: 502b077aed3SPierre Pronchery 503b077aed3SPierre Pronchery openssl ocsp -index demoCA/index.txt -rsigner rcert.pem -CA demoCA/cacert.pem 504b077aed3SPierre Pronchery -issuer demoCA/cacert.pem -serial 1 505b077aed3SPierre Pronchery 506b077aed3SPierre ProncheryQuery status information using request read from a file, and write the response 507b077aed3SPierre Proncheryto a second file. 508b077aed3SPierre Pronchery 509b077aed3SPierre Pronchery openssl ocsp -index demoCA/index.txt -rsigner rcert.pem -CA demoCA/cacert.pem 510b077aed3SPierre Pronchery -reqin req.der -respout resp.der 511b077aed3SPierre Pronchery 512b077aed3SPierre Pronchery=head1 HISTORY 513b077aed3SPierre Pronchery 514b077aed3SPierre ProncheryThe -no_alt_chains option was added in OpenSSL 1.1.0. 515b077aed3SPierre Pronchery 516b077aed3SPierre Pronchery=head1 COPYRIGHT 517b077aed3SPierre Pronchery 518b077aed3SPierre ProncheryCopyright 2001-2021 The OpenSSL Project Authors. All Rights Reserved. 519b077aed3SPierre Pronchery 520b077aed3SPierre ProncheryLicensed under the Apache License 2.0 (the "License"). You may not use 521b077aed3SPierre Proncherythis file except in compliance with the License. You can obtain a copy 522b077aed3SPierre Proncheryin the file LICENSE in the source distribution or at 523b077aed3SPierre ProncheryL<https://www.openssl.org/source/license.html>. 524b077aed3SPierre Pronchery 525b077aed3SPierre Pronchery=cut 526