Project

General

Profile

Download (11.9 KB) Statistics
| Branch: | Tag: | Revision:
1
# $FreeBSD$
2
#
3
# OpenSSL example configuration file.
4
# This is mostly being used for generation of certificate requests.
5
#
6

    
7
# This definition stops the following lines choking if HOME isn't
8
# defined.
9
HOME			= .
10
RANDFILE		= $ENV::HOME/.rnd
11

    
12
# pfSense: default SAN value if $ENV::SAN is not defined
13
#
14
SAN			=
15

    
16
# Extra OBJECT IDENTIFIER info:
17
#oid_file		= $ENV::HOME/.oid
18
oid_section		= new_oids
19

    
20
# To use this configuration file with the "-extfile" option of the
21
# "openssl x509" utility, name here the section containing the
22
# X.509v3 extensions to use:
23
# extensions		= 
24
# (Alternatively, use a configuration file that has only
25
# X.509v3 extensions in its main [= default] section.)
26

    
27
[ new_oids ]
28

    
29
# We can add new OIDs in here for use by 'ca', 'req' and 'ts'.
30
# Add a simple OID like this:
31
# testoid1=1.2.3.4
32
# Or use config file substitution like this:
33
# testoid2=${testoid1}.5.6
34

    
35
# Policies used by the TSA examples.
36
tsa_policy1 = 1.2.3.4.1
37
tsa_policy2 = 1.2.3.4.5.6
38
tsa_policy3 = 1.2.3.4.5.7
39

    
40
####################################################################
41
[ ca ]
42
default_ca	= CA_default		# The default ca section
43

    
44
####################################################################
45
[ CA_default ]
46

    
47
dir		= ./demoCA		# Where everything is kept
48
certs		= $dir/certs		# Where the issued certs are kept
49
crl_dir		= $dir/crl		# Where the issued crl are kept
50
database	= $dir/index.txt	# database index file.
51
#unique_subject	= no			# Set to 'no' to allow creation of
52
					# several ctificates with same subject.
53
new_certs_dir	= $dir/newcerts		# default place for new certs.
54

    
55
certificate	= $dir/cacert.pem 	# The CA certificate
56
serial		= $dir/serial 		# The current serial number
57
crlnumber	= $dir/crlnumber	# the current crl number
58
					# must be commented out to leave a V1 CRL
59
crl		= $dir/crl.pem 		# The current CRL
60
private_key	= $dir/private/cakey.pem# The private key
61
RANDFILE	= $dir/private/.rand	# private random number file
62

    
63
x509_extensions	= usr_cert		# The extentions to add to the cert
64

    
65
# Comment out the following two lines for the "traditional"
66
# (and highly broken) format.
67
name_opt 	= ca_default		# Subject Name options
68
cert_opt 	= ca_default		# Certificate field options
69

    
70
# Extension copying option: use with caution.
71
# copy_extensions = copy
72

    
73
# Extensions to add to a CRL. Note: Netscape communicator chokes on V2 CRLs
74
# so this is commented out by default to leave a V1 CRL.
75
# crlnumber must also be commented out to leave a V1 CRL.
76
crl_extensions	= crl_ext
77

    
78
default_days	= 365			# how long to certify for
79
default_crl_days= 30			# how long before next CRL
80
default_md	= default		# use public key default MD
81
preserve	= no			# keep passed DN ordering
82

    
83
# A few difference way of specifying how similar the request should look
84
# For type CA, the listed attributes must be the same, and the optional
85
# and supplied fields are just that :-)
86
policy		= policy_match
87

    
88
# For the CA policy
89
[ policy_match ]
90
countryName		= match
91
stateOrProvinceName	= match
92
organizationName	= match
93
organizationalUnitName	= optional
94
commonName		= supplied
95
emailAddress		= optional
96

    
97
# For the 'anything' policy
98
# At this point in time, you must list all acceptable 'object'
99
# types.
100
[ policy_anything ]
101
countryName		= optional
102
stateOrProvinceName	= optional
103
localityName		= optional
104
organizationName	= optional
105
organizationalUnitName	= optional
106
commonName		= supplied
107
emailAddress		= optional
108

    
109
####################################################################
110
[ req ]
111
prompt			= no
112
default_bits		= 2048
113
default_keyfile 	= privkey.pem
114
distinguished_name	= req_distinguished_name
115
attributes		= req_attributes
116
x509_extensions	= v3_ca	# The extentions to add to the self signed cert
117

    
118
# Passwords for private keys if not present they will be prompted for
119
# input_password = secret
120
# output_password = secret
121

    
122
# This sets a mask for permitted string types. There are several options. 
123
# default: PrintableString, T61String, BMPString.
124
# pkix	 : PrintableString, BMPString (PKIX recommendation before 2004)
125
# utf8only: only UTF8Strings (PKIX recommendation after 2004).
126
# nombstr : PrintableString, T61String (no BMPStrings or UTF8Strings).
127
# MASK:XXXX a literal mask value.
128
# WARNING: ancient versions of Netscape crash on BMPStrings or UTF8Strings.
129
string_mask = nombstr
130

    
131
req_extensions = v3_req # The extensions to add to a certificate request
132

    
133
[ req_distinguished_name ]
134
countryName			= Country Name (2 letter code)
135
countryName_default		= AU
136
countryName_min			= 2
137
countryName_max			= 2
138

    
139
stateOrProvinceName		= State or Province Name (full name)
140
stateOrProvinceName_default	= Some-State
141

    
142
localityName			= Locality Name (eg, city)
143

    
144
0.organizationName		= Organization Name (eg, company)
145
0.organizationName_default	= Internet Widgits Pty Ltd
146

    
147
# we can do this but it is not needed normally :-)
148
#1.organizationName		= Second Organization Name (eg, company)
149
#1.organizationName_default	= World Wide Web Pty Ltd
150

    
151
organizationalUnitName		= Organizational Unit Name (eg, section)
152
#organizationalUnitName_default	=
153

    
154
commonName			= Common Name (e.g. server FQDN or YOUR name)
155
commonName_max			= 64
156

    
157
emailAddress			= Email Address
158
emailAddress_max		= 64
159

    
160
# SET-ex3			= SET extension number 3
161

    
162
[ req_attributes ]
163
challengePassword		= A challenge password
164
challengePassword_min		= 4
165
challengePassword_max		= 20
166

    
167
unstructuredName		= An optional company name
168

    
169
[ usr_cert ]
170

    
171
# These extensions are added when 'ca' signs a request.
172

    
173
# This goes against PKIX guidelines but some CAs do it and some software
174
# requires this to avoid interpreting an end user certificate as a CA.
175

    
176
basicConstraints=CA:FALSE
177

    
178
# Here are some examples of the usage of nsCertType. If it is omitted
179
# the certificate can be used for anything *except* object signing.
180

    
181
# This is OK for an SSL server.
182
# nsCertType			= server
183

    
184
# For an object signing certificate this would be used.
185
# nsCertType = objsign
186

    
187
# For normal client use this is typical
188
# nsCertType = client, email
189

    
190
# and for everything including object signing:
191
# nsCertType = client, email, objsign
192

    
193
# This is typical in keyUsage for a client certificate.
194
keyUsage = nonRepudiation, digitalSignature, keyEncipherment
195

    
196
# This will be displayed in Netscape's comment listbox.
197
nsComment			= "OpenSSL Generated User Certificate"
198

    
199
# PKIX recommendations harmless if included in all certificates.
200
subjectKeyIdentifier=hash
201
authorityKeyIdentifier=keyid,issuer:always
202
extendedKeyUsage=clientAuth
203

    
204
# This stuff is for subjectAltName and issuerAltname.
205
# Import the email address.
206
# subjectAltName=email:copy
207
# An alternative to produce certificates that aren't
208
# deprecated according to PKIX.
209
# subjectAltName=email:move
210

    
211
# Copy subject details
212
# issuerAltName=issuer:copy
213

    
214
#nsCaRevocationUrl		= http://www.domain.dom/ca-crl.pem
215
#nsBaseUrl
216
#nsRevocationUrl
217
#nsRenewalUrl
218
#nsCaPolicyUrl
219
#nsSslServerName
220

    
221
# This is required for TSA certificates.
222
# extendedKeyUsage = critical,timeStamping
223

    
224
[ usr_cert_san ]
225

    
226
# copy of [ usr_cert ] plus nonempty Subject Alternative Names
227
basicConstraints		= CA:FALSE
228
nsComment			= "OpenSSL Generated User Certificate"
229
subjectKeyIdentifier		= hash
230
authorityKeyIdentifier		= keyid,issuer:always
231
extendedKeyUsage		= clientAuth
232
subjectAltName			= $ENV::SAN
233

    
234
[ server ]
235

    
236
# Make a cert with nsCertType=server
237
basicConstraints		= CA:FALSE
238
nsCertType			= server
239
nsComment			= "OpenSSL Generated Server Certificate"
240
subjectKeyIdentifier		= hash
241
authorityKeyIdentifier		= keyid,issuer:always
242
extendedKeyUsage		= serverAuth,1.3.6.1.5.5.8.2.2
243
keyUsage			= digitalSignature, keyEncipherment
244

    
245
[ server_san ]
246

    
247
# copy of [ server ] plus nonempty Subject Alternative Names
248
basicConstraints		= CA:FALSE
249
nsCertType			= server
250
nsComment			= "OpenSSL Generated Server Certificate"
251
subjectKeyIdentifier		= hash
252
authorityKeyIdentifier		= keyid,issuer:always
253
extendedKeyUsage		= serverAuth,1.3.6.1.5.5.8.2.2
254
keyUsage			= digitalSignature, keyEncipherment
255
subjectAltName			= $ENV::SAN
256

    
257
[ v3_req ]
258

    
259
# Extensions to add to a certificate request
260

    
261
basicConstraints = CA:FALSE
262
keyUsage = nonRepudiation, digitalSignature, keyEncipherment
263

    
264
[ v3_ca ]
265

    
266

    
267
# Extensions for a typical CA
268

    
269

    
270
# PKIX recommendation.
271

    
272
subjectKeyIdentifier=hash
273

    
274
authorityKeyIdentifier=keyid:always,issuer:always
275

    
276
# This is what PKIX recommends but some broken software chokes on critical
277
# extensions.
278
#basicConstraints = critical,CA:true
279
# So we do this instead.
280
basicConstraints = CA:true
281

    
282
# Key usage: this is typical for a CA certificate. However since it will
283
# prevent it being used as an test self-signed certificate it is best
284
# left out by default.
285
keyUsage = cRLSign, keyCertSign
286

    
287
# Some might want this also
288
# nsCertType = sslCA, emailCA
289

    
290
# Include email address in subject alt name: another PKIX recommendation
291
# subjectAltName=email:copy
292
# Copy issuer details
293
# issuerAltName=issuer:copy
294

    
295
# DER hex encoding of an extension: beware experts only!
296
# obj=DER:02:03
297
# Where 'obj' is a standard or added object
298
# You can even override a supported extension:
299
# basicConstraints= critical, DER:30:03:01:01:FF
300

    
301
[ v3_ca_san ]
302

    
303
# copy of [ v3_ca ] plus nonempty Subject Alternative Names
304
subjectKeyIdentifier=hash
305
authorityKeyIdentifier=keyid:always,issuer:always
306
basicConstraints=CA:true
307
subjectAltName=$ENV::SAN
308

    
309
[ crl_ext ]
310

    
311
# CRL extensions.
312
# Only issuerAltName and authorityKeyIdentifier make any sense in a CRL.
313

    
314
# issuerAltName=issuer:copy
315
authorityKeyIdentifier=keyid:always,issuer:always
316

    
317
[ proxy_cert_ext ]
318
# These extensions should be added when creating a proxy certificate
319

    
320
# This goes against PKIX guidelines but some CAs do it and some software
321
# requires this to avoid interpreting an end user certificate as a CA.
322

    
323
basicConstraints=CA:FALSE
324

    
325
# Here are some examples of the usage of nsCertType. If it is omitted
326
# the certificate can be used for anything *except* object signing.
327

    
328
# This is OK for an SSL server.
329
# nsCertType			= server
330

    
331
# For an object signing certificate this would be used.
332
# nsCertType = objsign
333

    
334
# For normal client use this is typical
335
# nsCertType = client, email
336

    
337
# and for everything including object signing:
338
# nsCertType = client, email, objsign
339

    
340
# This is typical in keyUsage for a client certificate.
341
# keyUsage = nonRepudiation, digitalSignature, keyEncipherment
342

    
343
# This will be displayed in Netscape's comment listbox.
344
nsComment			= "OpenSSL Generated Certificate"
345

    
346
# PKIX recommendations harmless if included in all certificates.
347
subjectKeyIdentifier=hash
348
authorityKeyIdentifier=keyid,issuer
349

    
350
# This stuff is for subjectAltName and issuerAltname.
351
# Import the email address.
352
# subjectAltName=email:copy
353
# An alternative to produce certificates that aren't
354
# deprecated according to PKIX.
355
# subjectAltName=email:move
356

    
357
# Copy subject details
358
# issuerAltName=issuer:copy
359

    
360
#nsCaRevocationUrl		= http://www.domain.dom/ca-crl.pem
361
#nsBaseUrl
362
#nsRevocationUrl
363
#nsRenewalUrl
364
#nsCaPolicyUrl
365
#nsSslServerName
366

    
367
# This really needs to be in place for it to be a proxy certificate.
368
proxyCertInfo=critical,language:id-ppl-anyLanguage,pathlen:3,policy:foo
369

    
370
####################################################################
371
[ tsa ]
372

    
373
default_tsa = tsa_config1	# the default TSA section
374

    
375
[ tsa_config1 ]
376

    
377
# These are used by the TSA reply generation only.
378
dir		= ./demoCA		# TSA root directory
379
serial		= $dir/tsaserial	# The current serial number (mandatory)
380
crypto_device	= builtin		# OpenSSL engine to use for signing
381
signer_cert	= $dir/tsacert.pem 	# The TSA signing certificate
382
					# (optional)
383
certs		= $dir/cacert.pem	# Certificate chain to include in reply
384
					# (optional)
385
signer_key	= $dir/private/tsakey.pem # The TSA private key (optional)
386

    
387
default_policy	= tsa_policy1		# Policy if request did not specify it
388
					# (optional)
389
other_policies	= tsa_policy2, tsa_policy3	# acceptable policies (optional)
390
digests		= md5, sha1		# Acceptable message digests (mandatory)
391
accuracy	= secs:1, millisecs:500, microsecs:100	# (optional)
392
clock_precision_digits  = 0	# number of digits after dot. (optional)
393
ordering		= yes	# Is ordering defined for timestamps?
394
				# (optional, default: no)
395
tsa_name		= yes	# Must the TSA name be included in the reply?
396
				# (optional, default: no)
397
ess_cert_id_chain	= no	# Must the ESS cert id chain be included?
398
				# (optional, default: no)
    (1-1/1)