xref: /openbsd/lib/libssl/doc/openssl.cnf (revision 40ca958b)
1913ec974Sbeck#
2913ec974Sbeck# OpenSSL example configuration file.
3913ec974Sbeck# This is mostly being used for generation of certificate requests.
4913ec974Sbeck#
5913ec974Sbeck
6ba5406e9Sbeck# This definition stops the following lines choking if HOME isn't
7ba5406e9Sbeck# defined.
8ba5406e9SbeckHOME			= .
9ba5406e9Sbeck
10ba5406e9Sbeck# Extra OBJECT IDENTIFIER info:
11ba5406e9Sbeck#oid_file		= $ENV::HOME/.oid
12913ec974Sbeckoid_section		= new_oids
13913ec974Sbeck
14913ec974Sbeck# To use this configuration file with the "-extfile" option of the
15913ec974Sbeck# "openssl x509" utility, name here the section containing the
16913ec974Sbeck# X.509v3 extensions to use:
17913ec974Sbeck# extensions		=
18913ec974Sbeck# (Alternatively, use a configuration file that has only
19913ec974Sbeck# X.509v3 extensions in its main [= default] section.)
20913ec974Sbeck
21913ec974Sbeck[ new_oids ]
22913ec974Sbeck
230a5d6edeSdjm# We can add new OIDs in here for use by 'ca', 'req' and 'ts'.
24913ec974Sbeck# Add a simple OID like this:
25913ec974Sbeck# testoid1=1.2.3.4
26913ec974Sbeck# Or use config file substitution like this:
27913ec974Sbeck# testoid2=${testoid1}.5.6
28913ec974Sbeck
290a5d6edeSdjm# Policies used by the TSA examples.
300a5d6edeSdjmtsa_policy1 = 1.2.3.4.1
310a5d6edeSdjmtsa_policy2 = 1.2.3.4.5.6
320a5d6edeSdjmtsa_policy3 = 1.2.3.4.5.7
330a5d6edeSdjm
34913ec974Sbeck####################################################################
35913ec974Sbeck[ ca ]
36913ec974Sbeckdefault_ca	= CA_default		# The default ca section
37913ec974Sbeck
38913ec974Sbeck####################################################################
39913ec974Sbeck[ CA_default ]
40913ec974Sbeck
41913ec974Sbeckdir		= ./demoCA		# Where everything is kept
42913ec974Sbeckcerts		= $dir/certs		# Where the issued certs are kept
43913ec974Sbeckcrl_dir		= $dir/crl		# Where the issued crl are kept
44913ec974Sbeckdatabase	= $dir/index.txt	# database index file.
456278d030Smarkus#unique_subject	= no			# Set to 'no' to allow creation of
46*40ca958bSjmc					# several certificates with same subject.
47913ec974Sbecknew_certs_dir	= $dir/newcerts		# default place for new certs.
48913ec974Sbeck
49913ec974Sbeckcertificate	= $dir/cacert.pem 	# The CA certificate
50913ec974Sbeckserial		= $dir/serial 		# The current serial number
514fcf65c5Sdjmcrlnumber	= $dir/crlnumber	# the current crl number
524fcf65c5Sdjm					# must be commented out to leave a V1 CRL
53913ec974Sbeckcrl		= $dir/crl.pem 		# The current CRL
54913ec974Sbeckprivate_key	= $dir/private/cakey.pem# The private key
55913ec974Sbeck
56*40ca958bSjmcx509_extensions	= usr_cert		# The extensions to add to the cert
57913ec974Sbeck
58da347917Sbeck# Comment out the following two lines for the "traditional"
59da347917Sbeck# (and highly broken) format.
60da347917Sbeckname_opt 	= ca_default		# Subject Name options
61da347917Sbeckcert_opt 	= ca_default		# Certificate field options
62da347917Sbeck
63da347917Sbeck# Extension copying option: use with caution.
64da347917Sbeck# copy_extensions = copy
65da347917Sbeck
66913ec974Sbeck# Extensions to add to a CRL. Note: Netscape communicator chokes on V2 CRLs
67913ec974Sbeck# so this is commented out by default to leave a V1 CRL.
686278d030Smarkus# crlnumber must also be commented out to leave a V1 CRL.
69913ec974Sbeck# crl_extensions	= crl_ext
70913ec974Sbeck
71913ec974Sbeckdefault_days	= 365			# how long to certify for
72913ec974Sbeckdefault_crl_days= 30			# how long before next CRL
730a5d6edeSdjmdefault_md	= default		# use public key default MD
74913ec974Sbeckpreserve	= no			# keep passed DN ordering
75913ec974Sbeck
76913ec974Sbeck# A few difference way of specifying how similar the request should look
77913ec974Sbeck# For type CA, the listed attributes must be the same, and the optional
78913ec974Sbeck# and supplied fields are just that :-)
79913ec974Sbeckpolicy		= policy_match
80913ec974Sbeck
81913ec974Sbeck# For the CA policy
82913ec974Sbeck[ policy_match ]
83913ec974SbeckcountryName		= match
84913ec974SbeckstateOrProvinceName	= match
85913ec974SbeckorganizationName	= match
86913ec974SbeckorganizationalUnitName	= optional
87913ec974SbeckcommonName		= supplied
88913ec974SbeckemailAddress		= optional
89913ec974Sbeck
90913ec974Sbeck# For the 'anything' policy
91913ec974Sbeck# At this point in time, you must list all acceptable 'object'
92913ec974Sbeck# types.
93913ec974Sbeck[ policy_anything ]
94913ec974SbeckcountryName		= optional
95913ec974SbeckstateOrProvinceName	= optional
96913ec974SbecklocalityName		= optional
97913ec974SbeckorganizationName	= optional
98913ec974SbeckorganizationalUnitName	= optional
99913ec974SbeckcommonName		= supplied
100913ec974SbeckemailAddress		= optional
101913ec974Sbeck
102913ec974Sbeck####################################################################
103913ec974Sbeck[ req ]
104913ec974Sbeckdefault_bits		= 1024
105913ec974Sbeckdefault_keyfile 	= privkey.pem
106913ec974Sbeckdistinguished_name	= req_distinguished_name
107913ec974Sbeckattributes		= req_attributes
108*40ca958bSjmcx509_extensions	= v3_ca	# The extensions to add to the self signed cert
109913ec974Sbeck
110ba5406e9Sbeck# Passwords for private keys if not present they will be prompted for
111ba5406e9Sbeck# input_password = secret
112ba5406e9Sbeck# output_password = secret
113ba5406e9Sbeck
114ba5406e9Sbeck# This sets a mask for permitted string types. There are several options.
115ba5406e9Sbeck# default: PrintableString, T61String, BMPString.
1160a5d6edeSdjm# pkix	 : PrintableString, BMPString (PKIX recommendation before 2004)
1170a5d6edeSdjm# utf8only: only UTF8Strings (PKIX recommendation after 2004).
118ba5406e9Sbeck# nombstr : PrintableString, T61String (no BMPStrings or UTF8Strings).
119ba5406e9Sbeck# MASK:XXXX a literal mask value.
1200a5d6edeSdjm# WARNING: ancient versions of Netscape crash on BMPStrings or UTF8Strings.
1210a5d6edeSdjmstring_mask = utf8only
122ba5406e9Sbeck
123ba5406e9Sbeck# req_extensions = v3_req # The extensions to add to a certificate request
124ba5406e9Sbeck
125913ec974Sbeck[ req_distinguished_name ]
126913ec974SbeckcountryName			= Country Name (2 letter code)
127913ec974SbeckcountryName_default		= AU
128913ec974SbeckcountryName_min			= 2
129913ec974SbeckcountryName_max			= 2
130913ec974Sbeck
131913ec974SbeckstateOrProvinceName		= State or Province Name (full name)
132913ec974SbeckstateOrProvinceName_default	= Some-State
133913ec974Sbeck
134913ec974SbecklocalityName			= Locality Name (eg, city)
135913ec974Sbeck
136913ec974Sbeck0.organizationName		= Organization Name (eg, company)
137913ec974Sbeck0.organizationName_default	= Internet Widgits Pty Ltd
138913ec974Sbeck
139913ec974Sbeck# we can do this but it is not needed normally :-)
140913ec974Sbeck#1.organizationName		= Second Organization Name (eg, company)
141913ec974Sbeck#1.organizationName_default	= World Wide Web Pty Ltd
142913ec974Sbeck
143913ec974SbeckorganizationalUnitName		= Organizational Unit Name (eg, section)
144913ec974Sbeck#organizationalUnitName_default	=
145913ec974Sbeck
14617150393SdjmcommonName			= Common Name (e.g. server FQDN or YOUR name)
147913ec974SbeckcommonName_max			= 64
148913ec974Sbeck
149913ec974SbeckemailAddress			= Email Address
150da347917SbeckemailAddress_max		= 64
151913ec974Sbeck
152913ec974Sbeck# SET-ex3			= SET extension number 3
153913ec974Sbeck
154913ec974Sbeck[ req_attributes ]
155913ec974SbeckchallengePassword		= A challenge password
156913ec974SbeckchallengePassword_min		= 4
157913ec974SbeckchallengePassword_max		= 20
158913ec974Sbeck
159913ec974SbeckunstructuredName		= An optional company name
160913ec974Sbeck
161913ec974Sbeck[ usr_cert ]
162913ec974Sbeck
163913ec974Sbeck# These extensions are added when 'ca' signs a request.
164913ec974Sbeck
165913ec974Sbeck# This goes against PKIX guidelines but some CAs do it and some software
166913ec974Sbeck# requires this to avoid interpreting an end user certificate as a CA.
167913ec974Sbeck
168913ec974SbeckbasicConstraints=CA:FALSE
169913ec974Sbeck
170913ec974Sbeck# Here are some examples of the usage of nsCertType. If it is omitted
171913ec974Sbeck# the certificate can be used for anything *except* object signing.
172913ec974Sbeck
173913ec974Sbeck# This is OK for an SSL server.
174913ec974Sbeck# nsCertType			= server
175913ec974Sbeck
176913ec974Sbeck# For an object signing certificate this would be used.
177913ec974Sbeck# nsCertType = objsign
178913ec974Sbeck
179913ec974Sbeck# For normal client use this is typical
180913ec974Sbeck# nsCertType = client, email
181913ec974Sbeck
182913ec974Sbeck# and for everything including object signing:
183913ec974Sbeck# nsCertType = client, email, objsign
184913ec974Sbeck
185913ec974Sbeck# This is typical in keyUsage for a client certificate.
186913ec974Sbeck# keyUsage = nonRepudiation, digitalSignature, keyEncipherment
187913ec974Sbeck
188913ec974Sbeck# This will be displayed in Netscape's comment listbox.
189913ec974SbecknsComment			= "OpenSSL Generated Certificate"
190913ec974Sbeck
191913ec974Sbeck# PKIX recommendations harmless if included in all certificates.
192913ec974SbecksubjectKeyIdentifier=hash
1934fcf65c5SdjmauthorityKeyIdentifier=keyid,issuer
194913ec974Sbeck
195913ec974Sbeck# This stuff is for subjectAltName and issuerAltname.
196913ec974Sbeck# Import the email address.
197913ec974Sbeck# subjectAltName=email:copy
198da347917Sbeck# An alternative to produce certificates that aren't
199da347917Sbeck# deprecated according to PKIX.
200da347917Sbeck# subjectAltName=email:move
201913ec974Sbeck
202913ec974Sbeck# Copy subject details
203913ec974Sbeck# issuerAltName=issuer:copy
204913ec974Sbeck
205913ec974Sbeck#nsCaRevocationUrl		= http://www.domain.dom/ca-crl.pem
206913ec974Sbeck#nsBaseUrl
207913ec974Sbeck#nsRevocationUrl
208913ec974Sbeck#nsRenewalUrl
209913ec974Sbeck#nsCaPolicyUrl
210913ec974Sbeck#nsSslServerName
211913ec974Sbeck
2120a5d6edeSdjm# This is required for TSA certificates.
2130a5d6edeSdjm# extendedKeyUsage = critical,timeStamping
2140a5d6edeSdjm
215ba5406e9Sbeck[ v3_req ]
216ba5406e9Sbeck
217ba5406e9Sbeck# Extensions to add to a certificate request
218ba5406e9Sbeck
219ba5406e9SbeckbasicConstraints = CA:FALSE
220ba5406e9SbeckkeyUsage = nonRepudiation, digitalSignature, keyEncipherment
221ba5406e9Sbeck
222913ec974Sbeck[ v3_ca ]
223913ec974Sbeck
224ba5406e9Sbeck
225913ec974Sbeck# Extensions for a typical CA
226913ec974Sbeck
227913ec974Sbeck
228913ec974Sbeck# PKIX recommendation.
229913ec974Sbeck
230913ec974SbecksubjectKeyIdentifier=hash
231913ec974Sbeck
2320a5d6edeSdjmauthorityKeyIdentifier=keyid:always,issuer
233913ec974Sbeck
234913ec974Sbeck# This is what PKIX recommends but some broken software chokes on critical
235913ec974Sbeck# extensions.
236913ec974Sbeck#basicConstraints = critical,CA:true
237913ec974Sbeck# So we do this instead.
238913ec974SbeckbasicConstraints = CA:true
239913ec974Sbeck
240913ec974Sbeck# Key usage: this is typical for a CA certificate. However since it will
241913ec974Sbeck# prevent it being used as an test self-signed certificate it is best
242913ec974Sbeck# left out by default.
243913ec974Sbeck# keyUsage = cRLSign, keyCertSign
244913ec974Sbeck
245913ec974Sbeck# Some might want this also
246913ec974Sbeck# nsCertType = sslCA, emailCA
247913ec974Sbeck
248913ec974Sbeck# Include email address in subject alt name: another PKIX recommendation
249913ec974Sbeck# subjectAltName=email:copy
250913ec974Sbeck# Copy issuer details
251913ec974Sbeck# issuerAltName=issuer:copy
252913ec974Sbeck
253ba5406e9Sbeck# DER hex encoding of an extension: beware experts only!
254ba5406e9Sbeck# obj=DER:02:03
255ba5406e9Sbeck# Where 'obj' is a standard or added object
256913ec974Sbeck# You can even override a supported extension:
257ba5406e9Sbeck# basicConstraints= critical, DER:30:03:01:01:FF
258913ec974Sbeck
259913ec974Sbeck[ crl_ext ]
260913ec974Sbeck
261913ec974Sbeck# CRL extensions.
262913ec974Sbeck# Only issuerAltName and authorityKeyIdentifier make any sense in a CRL.
263913ec974Sbeck
264913ec974Sbeck# issuerAltName=issuer:copy
2650a5d6edeSdjmauthorityKeyIdentifier=keyid:always
26640d8aef3Sdjm
26740d8aef3Sdjm[ proxy_cert_ext ]
26840d8aef3Sdjm# These extensions should be added when creating a proxy certificate
26940d8aef3Sdjm
27040d8aef3Sdjm# This goes against PKIX guidelines but some CAs do it and some software
27140d8aef3Sdjm# requires this to avoid interpreting an end user certificate as a CA.
27240d8aef3Sdjm
27340d8aef3SdjmbasicConstraints=CA:FALSE
27440d8aef3Sdjm
27540d8aef3Sdjm# Here are some examples of the usage of nsCertType. If it is omitted
27640d8aef3Sdjm# the certificate can be used for anything *except* object signing.
27740d8aef3Sdjm
27840d8aef3Sdjm# This is OK for an SSL server.
27940d8aef3Sdjm# nsCertType			= server
28040d8aef3Sdjm
28140d8aef3Sdjm# For an object signing certificate this would be used.
28240d8aef3Sdjm# nsCertType = objsign
28340d8aef3Sdjm
28440d8aef3Sdjm# For normal client use this is typical
28540d8aef3Sdjm# nsCertType = client, email
28640d8aef3Sdjm
28740d8aef3Sdjm# and for everything including object signing:
28840d8aef3Sdjm# nsCertType = client, email, objsign
28940d8aef3Sdjm
29040d8aef3Sdjm# This is typical in keyUsage for a client certificate.
29140d8aef3Sdjm# keyUsage = nonRepudiation, digitalSignature, keyEncipherment
29240d8aef3Sdjm
29340d8aef3Sdjm# This will be displayed in Netscape's comment listbox.
29440d8aef3SdjmnsComment			= "OpenSSL Generated Certificate"
29540d8aef3Sdjm
29640d8aef3Sdjm# PKIX recommendations harmless if included in all certificates.
29740d8aef3SdjmsubjectKeyIdentifier=hash
2980a5d6edeSdjmauthorityKeyIdentifier=keyid,issuer
29940d8aef3Sdjm
30040d8aef3Sdjm# This stuff is for subjectAltName and issuerAltname.
30140d8aef3Sdjm# Import the email address.
30240d8aef3Sdjm# subjectAltName=email:copy
30340d8aef3Sdjm# An alternative to produce certificates that aren't
30440d8aef3Sdjm# deprecated according to PKIX.
30540d8aef3Sdjm# subjectAltName=email:move
30640d8aef3Sdjm
30740d8aef3Sdjm# Copy subject details
30840d8aef3Sdjm# issuerAltName=issuer:copy
30940d8aef3Sdjm
31040d8aef3Sdjm#nsCaRevocationUrl		= http://www.domain.dom/ca-crl.pem
31140d8aef3Sdjm#nsBaseUrl
31240d8aef3Sdjm#nsRevocationUrl
31340d8aef3Sdjm#nsRenewalUrl
31440d8aef3Sdjm#nsCaPolicyUrl
31540d8aef3Sdjm#nsSslServerName
31640d8aef3Sdjm
31740d8aef3Sdjm# This really needs to be in place for it to be a proxy certificate.
31840d8aef3SdjmproxyCertInfo=critical,language:id-ppl-anyLanguage,pathlen:3,policy:foo
3190a5d6edeSdjm
3200a5d6edeSdjm####################################################################
3210a5d6edeSdjm[ tsa ]
3220a5d6edeSdjm
3230a5d6edeSdjmdefault_tsa = tsa_config1	# the default TSA section
3240a5d6edeSdjm
3250a5d6edeSdjm[ tsa_config1 ]
3260a5d6edeSdjm
3270a5d6edeSdjm# These are used by the TSA reply generation only.
3280a5d6edeSdjmdir		= ./demoCA		# TSA root directory
3290a5d6edeSdjmserial		= $dir/tsaserial	# The current serial number (mandatory)
3300a5d6edeSdjmcrypto_device	= builtin		# OpenSSL engine to use for signing
3310a5d6edeSdjmsigner_cert	= $dir/tsacert.pem 	# The TSA signing certificate
3320a5d6edeSdjm					# (optional)
3330a5d6edeSdjmcerts		= $dir/cacert.pem	# Certificate chain to include in reply
3340a5d6edeSdjm					# (optional)
3350a5d6edeSdjmsigner_key	= $dir/private/tsakey.pem # The TSA private key (optional)
3360a5d6edeSdjm
3370a5d6edeSdjmdefault_policy	= tsa_policy1		# Policy if request did not specify it
3380a5d6edeSdjm					# (optional)
3390a5d6edeSdjmother_policies	= tsa_policy2, tsa_policy3	# acceptable policies (optional)
3400a5d6edeSdjmdigests		= md5, sha1		# Acceptable message digests (mandatory)
3410a5d6edeSdjmaccuracy	= secs:1, millisecs:500, microsecs:100	# (optional)
3420a5d6edeSdjmclock_precision_digits  = 0	# number of digits after dot. (optional)
3430a5d6edeSdjmordering		= yes	# Is ordering defined for timestamps?
3440a5d6edeSdjm				# (optional, default: no)
3450a5d6edeSdjmtsa_name		= yes	# Must the TSA name be included in the reply?
3460a5d6edeSdjm				# (optional, default: no)
3470a5d6edeSdjmess_cert_id_chain	= no	# Must the ESS cert id chain be included?
3480a5d6edeSdjm				# (optional, default: no)
349