openssl-ocsp (1)
Leading comments
Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35) Standard preamble: ========================================================================
NAME
openssl-ocsp, ocsp - Online Certificate Status Protocol utilitySYNOPSIS
openssl ocsp [-help] [-out file] [-issuer file] [-cert file] [-serial n] [-signer file] [-signkey file] [-sign_other file] [-no_certs] [-req_text] [-resp_text] [-text] [-reqout file] [-respout file] [-reqin file] [-respin file] [-nonce] [-no_nonce] [-urlDESCRIPTION
The Online Certificate Status Protocol (The ocsp command performs many common
OPTIONS
This command operates as either a client or a server. The options are described below, divided into those two modes.OCSP Client Options
- -help
- Print out a usage message.
- -out filename
- specify output filename, default is standard output.
- -issuer filename
-
This specifies the current issuer certificate. This option can be used
multiple times. The certificate specified in filename must be in
PEMformat. This optionMUSTcome before any -cert options.
- -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.
- -serial num
- Same as the cert option except the certificate with serial number num is added to the request. The serial number is interpreted as a decimal integer unless preceded by 0x. Negative integers can also be specified by preceding the value by a - sign.
- -signer filename, -signkey filename
-
Sign the OCSPrequest 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 theOCSPrequest is not signed.
- -sign_other filename
- Additional certificates to include in the signed request.
- -nonce, -no_nonce
-
Add an OCSPnonce extension to a request or disableOCSPnonce addition. Normally if anOCSPrequest is input using the reqin option no nonce is added: using the nonce option will force addition of a nonce. If anOCSPrequest is being created (using cert and serial options) a nonce is automatically added specifying no_nonce overrides this.
- -req_text, -resp_text, -text
-
print out the text form of the OCSPrequest, response or both respectively.
- -reqout file, -respout file
-
write out the DERencoded certificate request or response to file.
- -reqin file, -respin file
-
read OCSPrequest or response file from file. These option are ignored ifOCSPrequest or response creation is implied by other options (for example with serial, cert and host options).
- -url responder_url
-
specify the responder URL.BothHTTPandHTTPS(SSL/TLS) URLs can be specified.
- -host hostname:port, -path pathname
-
if the host option is present then the OCSPrequest is sent to the host hostname on port port. path specifies theHTTPpath name to use or ``/'' by default. This is equivalent to specifying -url with scheme http:// and the given hostname, port, and pathname.
- -header name=value
-
Adds the header name with the specified value to the OCSPrequest that is sent to the responder. This may be repeated.
- -timeout seconds
-
connection timeout to the OCSPresponder in seconds
- -CAfile file, -CApath pathname
-
file or pathname containing trusted CAcertificates. These are used to verify the signature on theOCSPresponse.
- -no-CAfile
-
Do not load the trusted CAcertificates from the default file location
- -no-CApath
-
Do not load the trusted CAcertificates from the default directory location
- -attime, -check_ss_sig, -crl_check, -crl_check_all, -explicit_policy, -extended_crl, -ignore_critical, -inhibit_any, -inhibit_map, -no_alt_chains, -no_check_time, -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
- Set different certificate verification options. See verify(1) manual page for details.
- -verify_other file
-
file containing additional certificates to search when attempting to locate
the OCSPresponse 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.
- -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 CAis not appropriate.
- -VAfile file
- file containing explicitly trusted responder certificates. Equivalent to the -verify_other and -trust_other options.
- -noverify
-
don't attempt to verify the OCSPresponse 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
-
ignore certificates contained in the OCSPresponse 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
-
don't check the signature on the OCSPresponse. Since this option tolerates invalid signatures onOCSPresponses it will normally only be used for testing purposes.
- -no_cert_verify
-
don't verify the OCSPresponse signers certificate at all. Since this option allows theOCSPresponse to be signed by any certificate it should only be used for testing purposes.
- -no_chain
-
do not use certificates in the response as additional untrusted CAcertificates.
- -no_explicit
-
do not explicitly trust the root CAif it is set to be trusted forOCSPsigning.
- -no_cert_checks
-
don't perform any additional checks on the OCSPresponse 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
-
these options specify the range of times, in seconds, which will be tolerated
in an OCSPresponse. 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 theOCSPresponder and clients clocks may not be precisely synchronised and so such a check may fail. To avoid this the -validity_period option can be used to specify an acceptable error range in seconds, the default value is 5 minutes.
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 notBefore field is checked to see it is not older than age seconds old. By default this additional check is not performed.
- -[digest]
-
this option sets digest algorithm to use for certificate identification in the
OCSPrequest. Any digest supported by the OpenSSL dgst command can be used. The default isSHA-1.This option may be used multiple times to specify the digest used by subsequent certificate identifiers.
OCSP Server Options
- -index indexfile
-
indexfile is a text index file in ca format containing certificate revocation
information.
If the index option is specified the ocsp utility is in 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
OCSPclients (if port or url is specified).If the index option is present then the
CAand rsigner options must also be present. - -CA file
-
CAcertificate corresponding to the revocation information in indexfile.
- -rsigner file
-
The certificate to sign OCSPresponses with.
- -rother file
-
Additional certificates to include in the OCSPresponse.
- -resp_no_certs
-
Don't include any certificates in the OCSPresponse.
- -resp_key_id
-
Identify the signer certificate using the key ID,default is to use the subject name.
- -rkey file
-
The private key to sign OCSPresponses with: if not present the file specified in the rsigner option is used.
- -port portnum
-
Port to listen for OCSPrequests on. The port may also be specified using the url option.
- -nrequest number
-
The OCSPserver will exit after receiving number requests, default unlimited.
- -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 nextUpdate field is omitted meaning fresh revocation information is immediately available.
OCSP Response verification.
Initially the
Then a normal certificate verify is performed on the
If the initial verify fails then the
Otherwise the issuing
Otherwise the
Otherwise, if -no_explicit is not set the root
If none of these checks is successful then the
What this effectively means if that if the
If the
openssl x509 -in ocspCA.pem -addtrust OCSPSigning -out trustedCA.pem
Alternatively the responder certificate itself can be explicitly trusted with the -VAfile option.
NOTES
As noted, most of the verify options are for testing or debugging purposes. Normally only the -CApath, -CAfile and (if the responder is a 'globalThe
It is possible to run the ocsp application in responder mode via a
EXAMPLES
Create an
openssl ocsp -issuer issuer.pem -cert c1.pem -cert c2.pem -reqout req.der
Send a query to an
openssl ocsp -issuer issuer.pem -cert c1.pem -cert c2.pem \ -url ocsp.myhost.com -resp_text -respout resp.der
Read in an
openssl ocsp -respin resp.der -text -noverify
openssl ocsp -index demoCA/index.txt -port 8888 -rsigner rcert.pem -CA demoCA/cacert.pem -text -out log.txt
As above but exit after processing one request:
openssl ocsp -index demoCA/index.txt -port 8888 -rsigner rcert.pem -CA demoCA/cacert.pem -nrequest 1
Query status information using an internally generated request:
openssl ocsp -index demoCA/index.txt -rsigner rcert.pem -CA demoCA/cacert.pem -issuer demoCA/cacert.pem -serial 1
Query status information using request read from a file, and write the response to a second file.
openssl ocsp -index demoCA/index.txt -rsigner rcert.pem -CA demoCA/cacert.pem -reqin req.der -respout resp.der
HISTORY
The -no_alt_chains options was first added to OpenSSL 1.1.0.COPYRIGHT
Copyright 2001-2016 The OpenSSL Project Authors. All Rights Reserved.Licensed under the OpenSSL license (the ``License''). You may not use this file except in compliance with the License. You can obtain a copy in the file