openssl.cnf 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337
  1. [ new_oids ]
  2. # We can add new OIDs in here for use by 'ca', 'req' and 'ts'.
  3. # Add a simple OID like this:
  4. # testoid1=1.2.3.4
  5. # Or use config file substitution like this:
  6. # testoid2=${testoid1}.5.6
  7. # Policies used by the TSA examples.
  8. tsa_policy1 = 1.2.3.4.1
  9. tsa_policy2 = 1.2.3.4.5.6
  10. tsa_policy3 = 1.2.3.4.5.7
  11. ####################################################################
  12. [ ca ]
  13. default_ca = CA_default # The default ca section
  14. ####################################################################
  15. [ CA_default ]
  16. dir = ./demoCA # Where everything is kept
  17. certs = $dir/certs # Where the issued certs are kept
  18. crl_dir = $dir/crl # Where the issued crl are kept
  19. database = $dir/index.txt # database index file.
  20. #unique_subject = no # Set to 'no' to allow creation of
  21. # several ctificates with same subject.
  22. new_certs_dir = $dir/newcerts # default place for new certs.
  23. certificate = $dir/cacert.pem # The CA certificate
  24. serial = $dir/serial # The current serial number
  25. crlnumber = $dir/crlnumber # the current crl number
  26. # must be commented out to leave a V1 CRL
  27. crl = $dir/crl.pem # The current CRL
  28. private_key = $dir/private/cakey.pem# The private key
  29. RANDFILE = $dir/private/.rand # private random number file
  30. x509_extensions = usr_cert # The extentions to add to the cert
  31. # Comment out the following two lines for the "traditional"
  32. # (and highly broken) format.
  33. name_opt = ca_default # Subject Name options
  34. cert_opt = ca_default # Certificate field options
  35. # Extension copying option: use with caution.
  36. # copy_extensions = copy
  37. # Extensions to add to a CRL. Note: Netscape communicator chokes on V2 CRLs
  38. # so this is commented out by default to leave a V1 CRL.
  39. # crlnumber must also be commented out to leave a V1 CRL.
  40. # crl_extensions = crl_ext
  41. default_days = 365 # how long to certify for
  42. default_crl_days= 30 # how long before next CRL
  43. default_md = default # use public key default MD
  44. preserve = no # keep passed DN ordering
  45. # A few difference way of specifying how similar the request should look
  46. # For type CA, the listed attributes must be the same, and the optional
  47. # and supplied fields are just that :-)
  48. policy = policy_match
  49. # For the CA policy
  50. [ policy_match ]
  51. countryName = match
  52. stateOrProvinceName = match
  53. organizationName = match
  54. organizationalUnitName = optional
  55. commonName = supplied
  56. emailAddress = optional
  57. # For the 'anything' policy
  58. # At this point in time, you must list all acceptable 'object'
  59. # types.
  60. [ policy_anything ]
  61. countryName = optional
  62. stateOrProvinceName = optional
  63. localityName = optional
  64. organizationName = optional
  65. organizationalUnitName = optional
  66. commonName = supplied
  67. emailAddress = optional
  68. ####################################################################
  69. [ req ]
  70. default_bits = 1024
  71. default_keyfile = privkey.pem
  72. distinguished_name = req_distinguished_name
  73. attributes = req_attributes
  74. x509_extensions = v3_ca # The extentions to add to the self signed cert
  75. # Passwords for private keys if not present they will be prompted for
  76. # input_password = secret
  77. # output_password = secret
  78. # This sets a mask for permitted string types. There are several options.
  79. # default: PrintableString, T61String, BMPString.
  80. # pkix : PrintableString, BMPString (PKIX recommendation before 2004)
  81. # utf8only: only UTF8Strings (PKIX recommendation after 2004).
  82. # nombstr : PrintableString, T61String (no BMPStrings or UTF8Strings).
  83. # MASK:XXXX a literal mask value.
  84. # WARNING: ancient versions of Netscape crash on BMPStrings or UTF8Strings.
  85. string_mask = utf8only
  86. req_extensions = v3_req # The extensions to add to a certificate request
  87. [ req_distinguished_name ]
  88. countryName = Country Name (2 letter code)
  89. countryName_default = AU
  90. countryName_min = 2
  91. countryName_max = 2
  92. stateOrProvinceName = State or Province Name (full name)
  93. stateOrProvinceName_default = Some-State
  94. localityName = Locality Name (eg, city)
  95. 0.organizationName = Organization Name (eg, company)
  96. 0.organizationName_default = Internet Widgits Pty Ltd
  97. # we can do this but it is not needed normally :-)
  98. #1.organizationName = Second Organization Name (eg, company)
  99. #1.organizationName_default = World Wide Web Pty Ltd
  100. organizationalUnitName = Organizational Unit Name (eg, section)
  101. #organizationalUnitName_default =
  102. commonName = Common Name (e.g. server FQDN or YOUR name)
  103. commonName_max = 64
  104. emailAddress = Email Address
  105. emailAddress_max = 64
  106. # SET-ex3 = SET extension number 3
  107. [ req_attributes ]
  108. challengePassword = A challenge password
  109. challengePassword_min = 4
  110. challengePassword_max = 20
  111. unstructuredName = An optional company name
  112. [ usr_cert ]
  113. # This is required for TSA certificates.
  114. # This is required for client Auth and server Auth
  115. extendedKeyUsage = critical,timeStamping,serverAuth,clientAuth
  116. # These extensions are added when 'ca' signs a request.
  117. # This goes against PKIX guidelines but some CAs do it and some software
  118. # requires this to avoid interpreting an end user certificate as a CA.
  119. basicConstraints=CA:FALSE
  120. # Here are some examples of the usage of nsCertType. If it is omitted
  121. # the certificate can be used for anything *except* object signing.
  122. # This is OK for an SSL server.
  123. # nsCertType = server
  124. # For an object signing certificate this would be used.
  125. # nsCertType = objsign
  126. # For normal client use this is typical
  127. # nsCertType = client, email
  128. # and for everything including object signing:
  129. # nsCertType = client, email, objsign
  130. # This is typical in keyUsage for a client certificate.
  131. # keyUsage = nonRepudiation, digitalSignature, keyEncipherment
  132. # This will be displayed in Netscape's comment listbox.
  133. nsComment = "OpenSSL Generated Certificate"
  134. # PKIX recommendations harmless if included in all certificates.
  135. subjectKeyIdentifier=hash
  136. authorityKeyIdentifier=keyid,issuer
  137. # This stuff is for subjectAltName and issuerAltname.
  138. # Import the email address.
  139. # subjectAltName=email:copy
  140. # An alternative to produce certificates that aren't
  141. # deprecated according to PKIX.
  142. # subjectAltName=email:move
  143. # Copy subject details
  144. # issuerAltName=issuer:copy
  145. #nsCaRevocationUrl = http://www.domain.dom/ca-crl.pem
  146. #nsBaseUrl
  147. #nsRevocationUrl
  148. #nsRenewalUrl
  149. #nsCaPolicyUrl
  150. #nsSslServerName
  151. [ v3_req ]
  152. # Extensions to add to a certificate request
  153. basicConstraints = CA:FALSE
  154. keyUsage = nonRepudiation, digitalSignature, keyEncipherment
  155. extendedKeyUsage = critical,timeStamping,serverAuth,clientAuth
  156. subjectAltName = @alt_names
  157. [ v3_ca ]
  158. # Extensions for a typical CA
  159. # PKIX recommendation.
  160. subjectKeyIdentifier=hash
  161. authorityKeyIdentifier=keyid:always,issuer
  162. # This is what PKIX recommends but some broken software chokes on critical
  163. # extensions.
  164. #basicConstraints = critical,CA:true
  165. # So we do this instead.
  166. basicConstraints = CA:true
  167. keyUsage = keyCertSign, cRLSign
  168. # Key usage: this is typical for a CA certificate. However since it will
  169. # prevent it being used as an test self-signed certificate it is best
  170. # left out by default.
  171. # keyUsage = cRLSign, keyCertSign
  172. # Some might want this also
  173. # nsCertType = sslCA, emailCA
  174. # Include email address in subject alt name: another PKIX recommendation
  175. # subjectAltName=email:copy
  176. # Copy issuer details
  177. # issuerAltName=issuer:copy
  178. # DER hex encoding of an extension: beware experts only!
  179. # obj=DER:02:03
  180. # Where 'obj' is a standard or added object
  181. # You can even override a supported extension:
  182. # basicConstraints= critical, DER:30:03:01:01:FF
  183. [ crl_ext ]
  184. # CRL extensions.
  185. # Only issuerAltName and authorityKeyIdentifier make any sense in a CRL.
  186. # issuerAltName=issuer:copy
  187. authorityKeyIdentifier=keyid:always
  188. [ proxy_cert_ext ]
  189. # These extensions should be added when creating a proxy certificate
  190. # This goes against PKIX guidelines but some CAs do it and some software
  191. # requires this to avoid interpreting an end user certificate as a CA.
  192. basicConstraints=CA:FALSE
  193. # Here are some examples of the usage of nsCertType. If it is omitted
  194. # the certificate can be used for anything *except* object signing.
  195. # This is OK for an SSL server.
  196. # nsCertType = server
  197. # For an object signing certificate this would be used.
  198. # nsCertType = objsign
  199. # For normal client use this is typical
  200. # nsCertType = client, email
  201. # and for everything including object signing:
  202. # nsCertType = client, email, objsign
  203. # This is typical in keyUsage for a client certificate.
  204. # keyUsage = nonRepudiation, digitalSignature, keyEncipherment
  205. # This will be displayed in Netscape's comment listbox.
  206. nsComment = "OpenSSL Generated Certificate"
  207. # PKIX recommendations harmless if included in all certificates.
  208. subjectKeyIdentifier=hash
  209. authorityKeyIdentifier=keyid,issuer
  210. # This stuff is for subjectAltName and issuerAltname.
  211. # Import the email address.
  212. # subjectAltName=email:copy
  213. # An alternative to produce certificates that aren't
  214. # deprecated according to PKIX.
  215. # subjectAltName=email:move
  216. # Copy subject details
  217. # issuerAltName=issuer:copy
  218. #nsCaRevocationUrl = http://www.domain.dom/ca-crl.pem
  219. #nsBaseUrl
  220. #nsRevocationUrl
  221. #nsRenewalUrl
  222. #nsCaPolicyUrl
  223. #nsSslServerName
  224. # This really needs to be in place for it to be a proxy certificate.
  225. proxyCertInfo=critical,language:id-ppl-anyLanguage,pathlen:3,policy:foo
  226. ####################################################################
  227. [ tsa ]
  228. default_tsa = tsa_config1 # the default TSA section
  229. [ tsa_config1 ]
  230. # These are used by the TSA reply generation only.
  231. dir = ./demoCA # TSA root directory
  232. serial = $dir/tsaserial # The current serial number (mandatory)
  233. crypto_device = builtin # OpenSSL engine to use for signing
  234. signer_cert = $dir/tsacert.pem # The TSA signing certificate
  235. # (optional)
  236. certs = $dir/cacert.pem # Certificate chain to include in reply
  237. # (optional)
  238. signer_key = $dir/private/tsakey.pem # The TSA private key (optional)
  239. default_policy = tsa_policy1 # Policy if request did not specify it
  240. # (optional)
  241. other_policies = tsa_policy2, tsa_policy3 # acceptable policies (optional)
  242. digests = md5, sha1 # Acceptable message digests (mandatory)
  243. accuracy = secs:1, millisecs:500, microsecs:100 # (optional)
  244. clock_precision_digits = 0 # number of digits after dot. (optional)
  245. ordering = yes # Is ordering defined for timestamps?
  246. # (optional, default: no)
  247. tsa_name = yes # Must the TSA name be included in the reply?
  248. # (optional, default: no)
  249. ess_cert_id_chain = no # Must the ESS cert id chain be included?
  250. # (optional, default: no)
  251. [alt_names]
  252. IP.1 = 127.0.0.1