2
0

openssl.cnf 12 KB

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