xref: /openbsd/lib/libssl/doc/openssl.cnf (revision 6278d030)
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			= .
9913ec974SbeckRANDFILE		= $ENV::HOME/.rnd
10ba5406e9Sbeck
11ba5406e9Sbeck# Extra OBJECT IDENTIFIER info:
12ba5406e9Sbeck#oid_file		= $ENV::HOME/.oid
13913ec974Sbeckoid_section		= new_oids
14913ec974Sbeck
15913ec974Sbeck# To use this configuration file with the "-extfile" option of the
16913ec974Sbeck# "openssl x509" utility, name here the section containing the
17913ec974Sbeck# X.509v3 extensions to use:
18913ec974Sbeck# extensions		=
19913ec974Sbeck# (Alternatively, use a configuration file that has only
20913ec974Sbeck# X.509v3 extensions in its main [= default] section.)
21913ec974Sbeck
22913ec974Sbeck[ new_oids ]
23913ec974Sbeck
24913ec974Sbeck# We can add new OIDs in here for use by 'ca' and 'req'.
25913ec974Sbeck# Add a simple OID like this:
26913ec974Sbeck# testoid1=1.2.3.4
27913ec974Sbeck# Or use config file substitution like this:
28913ec974Sbeck# testoid2=${testoid1}.5.6
29913ec974Sbeck
30913ec974Sbeck####################################################################
31913ec974Sbeck[ ca ]
32913ec974Sbeckdefault_ca	= CA_default		# The default ca section
33913ec974Sbeck
34913ec974Sbeck####################################################################
35913ec974Sbeck[ CA_default ]
36913ec974Sbeck
37913ec974Sbeckdir		= ./demoCA		# Where everything is kept
38913ec974Sbeckcerts		= $dir/certs		# Where the issued certs are kept
39913ec974Sbeckcrl_dir		= $dir/crl		# Where the issued crl are kept
40913ec974Sbeckdatabase	= $dir/index.txt	# database index file.
41*6278d030Smarkus#unique_subject	= no			# Set to 'no' to allow creation of
42*6278d030Smarkus					# several ctificates with same subject.
43913ec974Sbecknew_certs_dir	= $dir/newcerts		# default place for new certs.
44913ec974Sbeck
45913ec974Sbeckcertificate	= $dir/cacert.pem 	# The CA certificate
46913ec974Sbeckserial		= $dir/serial 		# The current serial number
47*6278d030Smarkus#crlnumber	= $dir/crlnumber	# the current crl number
48*6278d030Smarkus					# must be commented out to leave a V1 CRL
49913ec974Sbeckcrl		= $dir/crl.pem 		# The current CRL
50913ec974Sbeckprivate_key	= $dir/private/cakey.pem# The private key
51913ec974SbeckRANDFILE	= $dir/private/.rand	# private random number file
52913ec974Sbeck
53913ec974Sbeckx509_extensions	= usr_cert		# The extentions to add to the cert
54913ec974Sbeck
55da347917Sbeck# Comment out the following two lines for the "traditional"
56da347917Sbeck# (and highly broken) format.
57da347917Sbeckname_opt 	= ca_default		# Subject Name options
58da347917Sbeckcert_opt 	= ca_default		# Certificate field options
59da347917Sbeck
60da347917Sbeck# Extension copying option: use with caution.
61da347917Sbeck# copy_extensions = copy
62da347917Sbeck
63913ec974Sbeck# Extensions to add to a CRL. Note: Netscape communicator chokes on V2 CRLs
64913ec974Sbeck# so this is commented out by default to leave a V1 CRL.
65*6278d030Smarkus# crlnumber must also be commented out to leave a V1 CRL.
66913ec974Sbeck# crl_extensions	= crl_ext
67913ec974Sbeck
68913ec974Sbeckdefault_days	= 365			# how long to certify for
69913ec974Sbeckdefault_crl_days= 30			# how long before next CRL
70913ec974Sbeckdefault_md	= md5			# which md to use.
71913ec974Sbeckpreserve	= no			# keep passed DN ordering
72913ec974Sbeck
73913ec974Sbeck# A few difference way of specifying how similar the request should look
74913ec974Sbeck# For type CA, the listed attributes must be the same, and the optional
75913ec974Sbeck# and supplied fields are just that :-)
76913ec974Sbeckpolicy		= policy_match
77913ec974Sbeck
78913ec974Sbeck# For the CA policy
79913ec974Sbeck[ policy_match ]
80913ec974SbeckcountryName		= match
81913ec974SbeckstateOrProvinceName	= match
82913ec974SbeckorganizationName	= match
83913ec974SbeckorganizationalUnitName	= optional
84913ec974SbeckcommonName		= supplied
85913ec974SbeckemailAddress		= optional
86913ec974Sbeck
87913ec974Sbeck# For the 'anything' policy
88913ec974Sbeck# At this point in time, you must list all acceptable 'object'
89913ec974Sbeck# types.
90913ec974Sbeck[ policy_anything ]
91913ec974SbeckcountryName		= optional
92913ec974SbeckstateOrProvinceName	= optional
93913ec974SbecklocalityName		= optional
94913ec974SbeckorganizationName	= optional
95913ec974SbeckorganizationalUnitName	= optional
96913ec974SbeckcommonName		= supplied
97913ec974SbeckemailAddress		= optional
98913ec974Sbeck
99913ec974Sbeck####################################################################
100913ec974Sbeck[ req ]
101913ec974Sbeckdefault_bits		= 1024
102913ec974Sbeckdefault_keyfile 	= privkey.pem
103913ec974Sbeckdistinguished_name	= req_distinguished_name
104913ec974Sbeckattributes		= req_attributes
105913ec974Sbeckx509_extensions	= v3_ca	# The extentions to add to the self signed cert
106913ec974Sbeck
107ba5406e9Sbeck# Passwords for private keys if not present they will be prompted for
108ba5406e9Sbeck# input_password = secret
109ba5406e9Sbeck# output_password = secret
110ba5406e9Sbeck
111ba5406e9Sbeck# This sets a mask for permitted string types. There are several options.
112ba5406e9Sbeck# default: PrintableString, T61String, BMPString.
113ba5406e9Sbeck# pkix	 : PrintableString, BMPString.
114ba5406e9Sbeck# utf8only: only UTF8Strings.
115ba5406e9Sbeck# nombstr : PrintableString, T61String (no BMPStrings or UTF8Strings).
116ba5406e9Sbeck# MASK:XXXX a literal mask value.
117ba5406e9Sbeck# WARNING: current versions of Netscape crash on BMPStrings or UTF8Strings
118ba5406e9Sbeck# so use this option with caution!
119ba5406e9Sbeckstring_mask = nombstr
120ba5406e9Sbeck
121ba5406e9Sbeck# req_extensions = v3_req # The extensions to add to a certificate request
122ba5406e9Sbeck
123913ec974Sbeck[ req_distinguished_name ]
124913ec974SbeckcountryName			= Country Name (2 letter code)
125913ec974SbeckcountryName_default		= AU
126913ec974SbeckcountryName_min			= 2
127913ec974SbeckcountryName_max			= 2
128913ec974Sbeck
129913ec974SbeckstateOrProvinceName		= State or Province Name (full name)
130913ec974SbeckstateOrProvinceName_default	= Some-State
131913ec974Sbeck
132913ec974SbecklocalityName			= Locality Name (eg, city)
133913ec974Sbeck
134913ec974Sbeck0.organizationName		= Organization Name (eg, company)
135913ec974Sbeck0.organizationName_default	= Internet Widgits Pty Ltd
136913ec974Sbeck
137913ec974Sbeck# we can do this but it is not needed normally :-)
138913ec974Sbeck#1.organizationName		= Second Organization Name (eg, company)
139913ec974Sbeck#1.organizationName_default	= World Wide Web Pty Ltd
140913ec974Sbeck
141913ec974SbeckorganizationalUnitName		= Organizational Unit Name (eg, section)
142913ec974Sbeck#organizationalUnitName_default	=
143913ec974Sbeck
144913ec974SbeckcommonName			= Common Name (eg, YOUR name)
145913ec974SbeckcommonName_max			= 64
146913ec974Sbeck
147913ec974SbeckemailAddress			= Email Address
148da347917SbeckemailAddress_max		= 64
149913ec974Sbeck
150913ec974Sbeck# SET-ex3			= SET extension number 3
151913ec974Sbeck
152913ec974Sbeck[ req_attributes ]
153913ec974SbeckchallengePassword		= A challenge password
154913ec974SbeckchallengePassword_min		= 4
155913ec974SbeckchallengePassword_max		= 20
156913ec974Sbeck
157913ec974SbeckunstructuredName		= An optional company name
158913ec974Sbeck
159913ec974Sbeck[ usr_cert ]
160913ec974Sbeck
161913ec974Sbeck# These extensions are added when 'ca' signs a request.
162913ec974Sbeck
163913ec974Sbeck# This goes against PKIX guidelines but some CAs do it and some software
164913ec974Sbeck# requires this to avoid interpreting an end user certificate as a CA.
165913ec974Sbeck
166913ec974SbeckbasicConstraints=CA:FALSE
167913ec974Sbeck
168913ec974Sbeck# Here are some examples of the usage of nsCertType. If it is omitted
169913ec974Sbeck# the certificate can be used for anything *except* object signing.
170913ec974Sbeck
171913ec974Sbeck# This is OK for an SSL server.
172913ec974Sbeck# nsCertType			= server
173913ec974Sbeck
174913ec974Sbeck# For an object signing certificate this would be used.
175913ec974Sbeck# nsCertType = objsign
176913ec974Sbeck
177913ec974Sbeck# For normal client use this is typical
178913ec974Sbeck# nsCertType = client, email
179913ec974Sbeck
180913ec974Sbeck# and for everything including object signing:
181913ec974Sbeck# nsCertType = client, email, objsign
182913ec974Sbeck
183913ec974Sbeck# This is typical in keyUsage for a client certificate.
184913ec974Sbeck# keyUsage = nonRepudiation, digitalSignature, keyEncipherment
185913ec974Sbeck
186913ec974Sbeck# This will be displayed in Netscape's comment listbox.
187913ec974SbecknsComment			= "OpenSSL Generated Certificate"
188913ec974Sbeck
189913ec974Sbeck# PKIX recommendations harmless if included in all certificates.
190913ec974SbecksubjectKeyIdentifier=hash
191913ec974SbeckauthorityKeyIdentifier=keyid,issuer:always
192913ec974Sbeck
193913ec974Sbeck# This stuff is for subjectAltName and issuerAltname.
194913ec974Sbeck# Import the email address.
195913ec974Sbeck# subjectAltName=email:copy
196da347917Sbeck# An alternative to produce certificates that aren't
197da347917Sbeck# deprecated according to PKIX.
198da347917Sbeck# subjectAltName=email:move
199913ec974Sbeck
200913ec974Sbeck# Copy subject details
201913ec974Sbeck# issuerAltName=issuer:copy
202913ec974Sbeck
203913ec974Sbeck#nsCaRevocationUrl		= http://www.domain.dom/ca-crl.pem
204913ec974Sbeck#nsBaseUrl
205913ec974Sbeck#nsRevocationUrl
206913ec974Sbeck#nsRenewalUrl
207913ec974Sbeck#nsCaPolicyUrl
208913ec974Sbeck#nsSslServerName
209913ec974Sbeck
210ba5406e9Sbeck[ v3_req ]
211ba5406e9Sbeck
212ba5406e9Sbeck# Extensions to add to a certificate request
213ba5406e9Sbeck
214ba5406e9SbeckbasicConstraints = CA:FALSE
215ba5406e9SbeckkeyUsage = nonRepudiation, digitalSignature, keyEncipherment
216ba5406e9Sbeck
217913ec974Sbeck[ v3_ca ]
218913ec974Sbeck
219ba5406e9Sbeck
220913ec974Sbeck# Extensions for a typical CA
221913ec974Sbeck
222913ec974Sbeck
223913ec974Sbeck# PKIX recommendation.
224913ec974Sbeck
225913ec974SbecksubjectKeyIdentifier=hash
226913ec974Sbeck
227913ec974SbeckauthorityKeyIdentifier=keyid:always,issuer:always
228913ec974Sbeck
229913ec974Sbeck# This is what PKIX recommends but some broken software chokes on critical
230913ec974Sbeck# extensions.
231913ec974Sbeck#basicConstraints = critical,CA:true
232913ec974Sbeck# So we do this instead.
233913ec974SbeckbasicConstraints = CA:true
234913ec974Sbeck
235913ec974Sbeck# Key usage: this is typical for a CA certificate. However since it will
236913ec974Sbeck# prevent it being used as an test self-signed certificate it is best
237913ec974Sbeck# left out by default.
238913ec974Sbeck# keyUsage = cRLSign, keyCertSign
239913ec974Sbeck
240913ec974Sbeck# Some might want this also
241913ec974Sbeck# nsCertType = sslCA, emailCA
242913ec974Sbeck
243913ec974Sbeck# Include email address in subject alt name: another PKIX recommendation
244913ec974Sbeck# subjectAltName=email:copy
245913ec974Sbeck# Copy issuer details
246913ec974Sbeck# issuerAltName=issuer:copy
247913ec974Sbeck
248ba5406e9Sbeck# DER hex encoding of an extension: beware experts only!
249ba5406e9Sbeck# obj=DER:02:03
250ba5406e9Sbeck# Where 'obj' is a standard or added object
251913ec974Sbeck# You can even override a supported extension:
252ba5406e9Sbeck# basicConstraints= critical, DER:30:03:01:01:FF
253913ec974Sbeck
254913ec974Sbeck[ crl_ext ]
255913ec974Sbeck
256913ec974Sbeck# CRL extensions.
257913ec974Sbeck# Only issuerAltName and authorityKeyIdentifier make any sense in a CRL.
258913ec974Sbeck
259913ec974Sbeck# issuerAltName=issuer:copy
260913ec974SbeckauthorityKeyIdentifier=keyid:always,issuer:always
261