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