ocspd.conf.3(3)
okay so bestie, this is ocspd.conf.3(3) from the OpenCA Contributed Manual and it's literally the whole lore on the OCSP Daemon config file π buckle up, it's long, it's detailed, and it's kinda iconic.
β¨ NAME β¨
ocspd.conf β the OCSP Daemon configuration file. that's it, that's the name π
π¦ DESCRIPTION π¦
okay so a config file is split into a bunch of sections. every section starts with a line that looks like [ section_name ] and it ends the moment a new section starts, or when you hit end of file. a section name can be made of alphanumeric characters and underscores. simple as that β¨
the first section of a config file is special β it's called the default section. it's usually unnamed and it runs from the start of the file until the first named section shows up. when something's name is being looked up, it gets looked up in a named section first (if there is one), and then in the default section. no cap π
the environment gets mapped onto a section called ENV.
you can drop comments in by putting a # character in front of them. very demure, very mindful π
every section in a config file is just a bunch of name and value pairs shaped like name=value.
the name string can hold any alphanumeric characters plus a few punctuation symbols like ., ,, ; and _.
the value string is everything after the = character until end of line, with any leading and trailing white space removed. squeaky clean π§
now the fun part β the value string goes through variable expansion. you do it by writing $var or ${var}, and that substitutes the value of the named variable in the current section. you can also pull a value from a different section using $section::name or ${section::name}. and by using the form $ENV::name you can substitute environment variables in. you can even assign values to environment variables by using the name ENV::name β and this works if the program looks up environment variables using the CONF library instead of calling getenv() directly. iykyk π
escaping is a thing too: you can escape certain characters by using any kind of quote or the \ character. and if you make the last character of a line a \, the value string can be spread across multiple lines. on top of that, the sequences \n, \r, \b and \t are recognized. so you're covered π«Ά
π NOTES π
real talk: if a config file tries to expand a variable that doesn't exist, then an error is flagged and the file will not load. periodt. this can totally happen if you try to expand an environment variable that isn't there. for example, the default OpenSSL master configuration file used the value of HOME, which may not be defined on non Unix systems. so watch out for that π
πΈ EXAMPLE πΈ
here's a sample configuration file, bestie:
# OCSPd example configuration file.
# (c) 2001 by Massimiliano Pala - OpenCA Project.
# All rights reserved
[ ocspd ]
default_ocspd = OCSPD_default
[ OCSPD_default ]
dir = /usr/local/etc/ocspd
db = $dir/index.txt
md = sha1
ca_certificate = $dir/certs/cacert.pem
ocspd_certificate = $dir/certs/ocspd_cert.pem
ocspd_key = $dir/private/ocspd_key.pem
pidfile = $dir/ocspd.pid
user = ocspd
group = daemon
bind = *
port = 2560
threads_num = 150
max_req_size = 8192
request = ocsp_req
response = ocsp_response
dbms = dbms_ldap # Example using the LDAP for CRL
# retrivial
#dbms = dbms_file # Example using file for CRL
engine = HSM # ENGINE section
####################################################################
[ ocsp_req ]
default_keyfile = key.pem
####################################################################
[ ocsp_response ]
dir = /usr/local/etc/ocspd
ocsp_add_response_certs = $dir/certs/chain_certs.pem
ocsp_add_response_keyid = yes
next_update_days = 0
next_update_mins = 5
####################################################################
[ dbms_ldap ]
# It is possible to use an URI to identify a CRL and/or the
# CA certificate, the general format is:
#
# [protocol]://[user[:pwd]@]server[:port]/[path]
#
# where:
# protocol - specifies the protocol to be used, supported are
# file, ldap, http
# user - is the user for auth (meaningful only if ldap or
# http is used)
# pwd - password used for auth (meaningful only if ldap
# or http is used)
# port - port to connect to (meaningful only if ldap or
# http is used)
# path - complete path to the object (meaningful only if
# http is used)
#
# You can have the CRLs/CA certificates on a simple file
# crl_url = file:///usr/local/etc/ocspd/crl.pem
# ca_url = file:///usr/local/etc/ocspd/ca.pem
#
# You can retrieve the CRLs/CA certificates from a web server
# crl_url = http://server/ca/cacert.crl.der
# ca_url = http://server/ca/cacert.der
#
# You can store the CRL into an LDAP server, simply
# store it in certificateRevocationList;binary attribute
#
# There are different way, all legal, to specify the CRL/CA
# URL address:
# crl_url = ldap://user:pwd@ldap.server.org:389
# crl_url = ldap://ldap.server.org:389
crl_url = ldap://localhost
ca_url = ldap://localhost
# The CRL entry DN is the DN to look for when retrieving the
# date from the LDAP server. Put here the complete DN (usually
# the DN of the CA's certificate).
crl_entry_dn = "email=email@address, cn=Certification Auth, \
o=Organization, c=IT"
# To retrieve the CRL from LDAP the attribute where it is stored is to
# be specified. Usually this should be set to:
#
# certificateRevocationList;binary
#
# anyway existing LDAP installations or new standards can mandate
# for different attributes for storing CRLs into. Use this parameter
# to specify the attribute used to retrieve the CRL from.
#
# This option is needed only if the CRL is stored on LDAP
crl_entry_attribute = "certificateRevocationList;binary"
# We need the CA certificate for every CA we support. Upon loading
# the CRL and the CA certificate a simple check is made to ensure
# the CRL/CA certificate matching. Also the CA certificate is used
# to retrieve the CID used to identify the certificate being
# requested by the client (CID of the Issuer + serial Number).
# Like the CRL URL, the URL scheme for the CA may be file, ldap or http.
ca_url = ldap://localhost
# DN where the cACertificate;binary value can be downloaded
# This option is needed only if the CA Certificate is stored on LDAP
ca_entry_dn = "o=Organisation, c=IT"
# This is the attribute used to store the CA.
ca_entry_attribute = "caCertificate;binary"
# Server Certificate to attach to the response
server_cert = file:///etc/ocspd/certs/ocspd_cert.pem
####################################################################
[ dbms_file ]
# You can have the CRL on a simple file in PEM format
crl_url = file:///usr/local/etc/ocspd/crl.pem
[ HSM ]
# Hardware accelerators support via the ENGINE interface
engine_id = MyAccelerator
0.engine_pre = login:1:10:11:myPassword
# 0.engine_post = logout:1:10:11
let's analyze the options in detail πβ¨
π default_ocspd section π
in this section of the configuration file you set the general options used by the responder β and some of them are available through the command line options too (see ocspd(3)).
dirβ specifies the directory where everything is kept. your whole little home base πdbβ specifies the db where info about issued certificates is kept. right now the only supported file format is the one fromopenssl(1). to reload the certificate's db, simply send aSIGHUPto the main process (kill -s SIGHUP pid). so casual πmdβ specifies the digest to be used. default issha1.ca_certificateβ path to the CA's certificate.ocspd_certificateβ path to the certificate to be used by the responder.ocspd_keyβ path to the private key file to be used by the responder.pidfileβ path to the pid file where the responder will write its pid when starting.userβ user id the responder will try to run as; this must be a valid UID. if not specified, the responder will run as the user who started the daemon.groupβ group id the responder will try to run as; this must be a valid GID. if not specified, the responder will run as the user who started the daemon.bindβ address to listen to. you can force the responder to listen to just one of the available addresses. if you want the responder to listen to every available interface, simply use'*'(default). main character energy, listening to everything β¨portβ specifies the port to listen to.max_req_sizeβ maximum size of received request; if a received request is bigger it will be trashed. usually simple requests are 200/300 bytes long (more or less).threads_numβ number of threads that shall be created at startup time. the more threads, the better for handling very high traffic. they expect better performances on multi-threaded machines and processors. from version 1.5+ the server is not pre-forked β instead it's a pre-threaded one. in order to run, the server needs support for POSIX1.c as found in most modern UNiX systems. slay π§΅max_client_numβ length of the system'slisten()queue. up to this number of not-yet-served connection requests are queued by the system. additional ones are dropped. default is30.max_timeout_secsβ max timeout for request receiving. if a request is not received within the specified number of seconds then the socket is closed in order to free unused threads. if not set, the default value is5seconds.http_protoβ HTTP protocol version to be required. if1.1is specified, then the"Host: <addr>"name is also used in the header of HTTP GET requests.chroot_dirβ chroot the application into the specified directory. watch out bestie, because if you chroot the application, all the paths should be relative to the new root for CRL reloading β or (better solution) you have to download the CRLs from HTTP or LDAP. if you chroot and you do not provide support for privileges dropping, privileges will not be dropped and an error will be written in the logfile, but the server will continue to run assuming thechroot()is sufficiently isolated to prevent abuse of the machine. > so yeah, that's a real one β the server keeps running anyway, so make sure that chroot is doing the heavy lifting πcrl_auto_reloadβ okay so this is the auto reload interval of the CRL, in seconds. If you set it to0or it's not present at all, then to reload the CRL you'll need to send aSIGHUP(kill -1 <pid>) to the parent process. no cap. πcrl_check_validityβ CRL validity check period, in seconds. If this parameter is set to#n, then the CRL is checked every#nsecs, and if the CRL's validity period is expired, then all the responses will be set to'unknown'. If it's set to'0'or not specified, all responses will be based on the loaded CRL, no matter if it is expired or not. lowkey important. π«Άcrl_reload_expiredβ If the currently loaded CRL is expired, reload it. Set this parameter to"yes"only if you are sure that the new CRL will be issued and put in thecrl_urllocation.
only if you are sure, bestie. no cap. π¨
request section
Currently not used. it's giving placeholder energy, but fr it's just sitting there unused. π
response section
Here are kept options tied to responses' building. this is where the response glow-up happens. β¨
dbms section
Here are kept options tied to the revoked certificates' list. the revoked girlies live here. π
ocsp_add_response_certsβ specifies path to a file containing certificates to be added to the response (usually the whole certification chain). Certificates have to be in PEM format one after another (a simplecatof the certificates will do fine). so just cat them together, fr fr. πocsp_add_response_keyidβ specifies if adding of the key id to the response. yes, that's the whole description, it's giving cryptic. πnext_update_daysβ specifies the number of days till next update is available. A response will be valid in the period following the request till thedays+mins. β³next_update_minsβ specifies the number of minutes till next update is available. A response will be valid in the period following the request till thedays+mins. β°ca_urlβ specifies the URI where the CA certificate (which identifies the single CA) is located. Three different protocols are implemented (file://,http://orldap://). Iffileis chosen, then the parameter should carry the path to the CA file (i.e.file:///usr/local/etc/ca.pem). Ifldaporhttpis chosen, you can specify the address, and the port of the server where to connect to (i.e.ldap://server.addr:port). πcrl_urlβ specifies the URI where the CRL (list of revoked certificates, actually used for building responses) is located. Three different protocols are actually implemented (file://,http://orldap://). Iffileis chosen, then the parameter should have the path to the crl file (i.e.file:///usr/local/etc/cacrl.pem). Ifldaporhttpis chosen, you can specify the address, and the port of the server where to connect to (i.e.ldap://server.addr:port). πcrl_entry_dnβ specifies, ifldap://protocol is chosen within thecrl_urlparameter, the entry where to look for thecertificateRevocationListattribute where the CRL should be present (usually this is also the base of the LDAP tree, but different installations are also possible). π³
ENGINE section
engine_idβ Specifies the ENGINE id to be used - check OpenSSL and your HSM vendor to get more info about this parameter. πengine_preβ Some HSM need initialisation before access to the crypto accelerated functions is granted. It is possible, by using the'engine_pre'options to issue needed commands directly to the HSM.
The format is as follows:
0.engine_pre = cmd:values
1.engine_pre = cmd2:values
... It is possible to have as many commands as needed.
so you can stack as many commands as needed. π
engine_postβ Some HSMs need to perform commands after the ENGINE initialisation which are taken from the'engine_post'option. Usage and format is exactly the same as'engine_pre', the difference is that commands are sent to the HSM after theENGINE_init()function. Refer to your HSM documentation for more informations. π
AUTHOR
Massimiliano Pala <madwolf@openca.org> β iconic. π
SEE ALSO
ocspd(3),openca(3),openssl(1), ocsp(1) β go read these next, bestie. π
this page was brought to you by openca-ocspd 1.5.1 on 2006-10-13 πβ¨
π¦ where this page comes from
- fedora 43: ocspd 1.9.0-35.fc43 Β· Apache-1.0
- fedora 44: ocspd 1.9.0-36.fc44 Β· Apache-1.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms