openssl.cnf 11 KB

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