openssl.cnf 6.1 KB
Newer Older
1
#
2
# OpenSSL example configuration file.
3 4 5 6
# This is mostly being used for generation of certificate requests.
#

RANDFILE		= $ENV::HOME/.rnd
7
oid_file		= $ENV::HOME/.oid
8 9
oid_section		= new_oids

10
# To use this configuration file with the "-extfile" option of the
11 12 13 14 15 16
# "openssl x509" utility, name here the section containing the
# X.509v3 extensions to use:
# extensions		= 
# (Alternatively, use a configuration file that has only
# X.509v3 extensions in its main [= default] section.)

17 18 19 20 21 22 23
[ new_oids ]

# We can add new OIDs in here for use by 'ca' and 'req'.
# Add a simple OID like this:
# testoid1=1.2.3.4
# Or use config file substitution like this:
# testoid2=${testoid1}.5.6
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43

####################################################################
[ ca ]
default_ca	= CA_default		# The default ca section

####################################################################
[ CA_default ]

dir		= ./demoCA		# Where everything is kept
certs		= $dir/certs		# Where the issued certs are kept
crl_dir		= $dir/crl		# Where the issued crl are kept
database	= $dir/index.txt	# database index file.
new_certs_dir	= $dir/newcerts		# default place for new certs.

certificate	= $dir/cacert.pem 	# The CA certificate
serial		= $dir/serial 		# The current serial number
crl		= $dir/crl.pem 		# The current CRL
private_key	= $dir/private/cakey.pem# The private key
RANDFILE	= $dir/private/.rand	# private random number file

44
x509_extensions	= usr_cert		# The extentions to add to the cert
45 46 47 48 49

# Extensions to add to a CRL. Note: Netscape communicator chokes on V2 CRLs
# so this is commented out by default to leave a V1 CRL.
# crl_extensions	= crl_ext

50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86
default_days	= 365			# how long to certify for
default_crl_days= 30			# how long before next CRL
default_md	= md5			# which md to use.
preserve	= no			# keep passed DN ordering

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

# For the CA policy
[ policy_match ]
countryName		= match
stateOrProvinceName	= match
organizationName	= match
organizationalUnitName	= optional
commonName		= supplied
emailAddress		= optional

# For the 'anything' policy
# At this point in time, you must list all acceptable 'object'
# types.
[ policy_anything ]
countryName		= optional
stateOrProvinceName	= optional
localityName		= optional
organizationName	= optional
organizationalUnitName	= optional
commonName		= supplied
emailAddress		= optional

####################################################################
[ req ]
default_bits		= 1024
default_keyfile 	= privkey.pem
distinguished_name	= req_distinguished_name
attributes		= req_attributes
87
x509_extensions	= v3_ca	# The extentions to add to the self signed cert
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104

[ req_distinguished_name ]
countryName			= Country Name (2 letter code)
countryName_default		= AU
countryName_min			= 2
countryName_max			= 2

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

localityName			= Locality Name (eg, city)

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

# we can do this but it is not needed normally :-)
#1.organizationName		= Second Organization Name (eg, company)
105
#1.organizationName_default	= World Wide Web Pty Ltd
106 107 108 109 110 111 112 113 114 115

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

commonName			= Common Name (eg, YOUR name)
commonName_max			= 64

emailAddress			= Email Address
emailAddress_max		= 40

116
# SET-ex3			= SET extension number 3
117

118 119 120 121 122 123 124
[ req_attributes ]
challengePassword		= A challenge password
challengePassword_min		= 4
challengePassword_max		= 20

unstructuredName		= An optional company name

125
[ usr_cert ]
126

127
# These extensions are added when 'ca' signs a request.
128

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

132 133 134 135 136 137
basicConstraints=CA:FALSE

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

# This is OK for an SSL server.
138
# nsCertType			= server
139 140

# For an object signing certificate this would be used.
141
# nsCertType = objsign
142 143

# For normal client use this is typical
144
# nsCertType = client, email
145

146 147
# and for everything including object signing:
# nsCertType = client, email, objsign
148

149 150
# This is typical in keyUsage for a client certificate.
# keyUsage = nonRepudiation, digitalSignature, keyEncipherment
151

152
# This will be displayed in Netscape's comment listbox.
153
nsComment			= "OpenSSL Generated Certificate"
154

155
# PKIX recommendations harmless if included in all certificates.
156
subjectKeyIdentifier=hash
157 158
authorityKeyIdentifier=keyid,issuer:always

159
# This stuff is for subjectAltName and issuerAltname.
160
# Import the email address.
161
# subjectAltName=email:copy
162 163

# Copy subject details
164
# issuerAltName=issuer:copy
165 166

#nsCaRevocationUrl		= http://www.domain.dom/ca-crl.pem
167 168 169 170 171 172
#nsBaseUrl
#nsRevocationUrl
#nsRenewalUrl
#nsCaPolicyUrl
#nsSslServerName

R
Ralf S. Engelschall 已提交
173
[ v3_ca ]
174 175 176 177

# Extensions for a typical CA


178 179 180 181
# PKIX recommendation.

subjectKeyIdentifier=hash

182 183
authorityKeyIdentifier=keyid:always,issuer:always

184 185 186
# This is what PKIX recommends but some broken software chokes on critical
# extensions.
#basicConstraints = critical,CA:true
187 188
# So we do this instead.
basicConstraints = CA:true
189

190 191 192 193
# Key usage: this is typical for a CA certificate. However since it will
# prevent it being used as an test self-signed certificate it is best
# left out by default.
# keyUsage = cRLSign, keyCertSign
194

195
# Some might want this also
196
# nsCertType = sslCA, emailCA
197

198
# Include email address in subject alt name: another PKIX recommendation
199
# subjectAltName=email:copy
200
# Copy issuer details
201
# issuerAltName=issuer:copy
202

203 204 205 206
# RAW DER hex encoding of an extension: beware experts only!
# 1.2.3.5=RAW:02:03
# You can even override a supported extension:
# basicConstraints= critical, RAW:30:03:01:01:FF
207 208 209 210 211 212

[ crl_ext ]

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

213
# issuerAltName=issuer:copy
214
authorityKeyIdentifier=keyid:always,issuer:always