openssl.cnf 11 KB

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