openssl.cnf 12 KB

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