openssl.cnf 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288
  1. # For use with easy-rsa version 2.0 and OpenSSL 1.0.0*
  2. # This definition stops the following lines choking if HOME isn't
  3. # defined.
  4. HOME = .
  5. RANDFILE = $ENV::HOME/.rnd
  6. openssl_conf = openssl_init
  7. [ openssl_init ]
  8. # Extra OBJECT IDENTIFIER info:
  9. #oid_file = $ENV::HOME/.oid
  10. oid_section = new_oids
  11. engines = engine_section
  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' and 'req'.
  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. ####################################################################
  25. [ ca ]
  26. default_ca = CA_default # The default ca section
  27. ####################################################################
  28. [ CA_default ]
  29. dir = $ENV::KEY_DIR # Where everything is kept
  30. certs = $dir # Where the issued certs are kept
  31. crl_dir = $dir # Where the issued crl are kept
  32. database = $dir/index.txt # database index file.
  33. new_certs_dir = $dir # default place for new certs.
  34. certificate = $dir/ca.crt # The CA certificate
  35. serial = $dir/serial # The current serial number
  36. crl = $dir/crl.pem # The current CRL
  37. private_key = $dir/ca.key # The private key
  38. RANDFILE = $dir/.rand # private random number file
  39. x509_extensions = usr_cert # The extentions to add to the cert
  40. # Extensions to add to a CRL. Note: Netscape communicator chokes on V2 CRLs
  41. # so this is commented out by default to leave a V1 CRL.
  42. # crl_extensions = crl_ext
  43. default_days = 3650 # how long to certify for
  44. default_crl_days= 30 # how long before next CRL
  45. default_md = sha256 # use public key default MD
  46. preserve = no # keep passed DN ordering
  47. # A few difference way of specifying how similar the request should look
  48. # For type CA, the listed attributes must be the same, and the optional
  49. # and supplied fields are just that :-)
  50. policy = policy_anything
  51. # For the CA policy
  52. [ policy_match ]
  53. countryName = match
  54. stateOrProvinceName = match
  55. organizationName = match
  56. organizationalUnitName = optional
  57. commonName = supplied
  58. name = optional
  59. emailAddress = optional
  60. # For the 'anything' policy
  61. # At this point in time, you must list all acceptable 'object'
  62. # types.
  63. [ policy_anything ]
  64. countryName = optional
  65. stateOrProvinceName = optional
  66. localityName = optional
  67. organizationName = optional
  68. organizationalUnitName = optional
  69. commonName = supplied
  70. name = optional
  71. emailAddress = optional
  72. ####################################################################
  73. [ req ]
  74. default_bits = $ENV::KEY_SIZE
  75. default_keyfile = privkey.pem
  76. default_md = sha256
  77. distinguished_name = req_distinguished_name
  78. attributes = req_attributes
  79. x509_extensions = v3_ca # The extentions to add to the self signed cert
  80. # Passwords for private keys if not present they will be prompted for
  81. # input_password = secret
  82. # output_password = secret
  83. # This sets a mask for permitted string types. There are several options.
  84. # default: PrintableString, T61String, BMPString.
  85. # pkix : PrintableString, BMPString (PKIX recommendation after 2004).
  86. # utf8only: only UTF8Strings (PKIX recommendation after 2004).
  87. # nombstr : PrintableString, T61String (no BMPStrings or UTF8Strings).
  88. # MASK:XXXX a literal mask value.
  89. string_mask = nombstr
  90. # req_extensions = v3_req # The extensions to add to a certificate request
  91. [ req_distinguished_name ]
  92. countryName = Country Name (2 letter code)
  93. countryName_default = $ENV::KEY_COUNTRY
  94. countryName_min = 2
  95. countryName_max = 2
  96. stateOrProvinceName = State or Province Name (full name)
  97. stateOrProvinceName_default = $ENV::KEY_PROVINCE
  98. localityName = Locality Name (eg, city)
  99. localityName_default = $ENV::KEY_CITY
  100. 0.organizationName = Organization Name (eg, company)
  101. 0.organizationName_default = $ENV::KEY_ORG
  102. # we can do this but it is not needed normally :-)
  103. #1.organizationName = Second Organization Name (eg, company)
  104. #1.organizationName_default = World Wide Web Pty Ltd
  105. organizationalUnitName = Organizational Unit Name (eg, section)
  106. #organizationalUnitName_default =
  107. commonName = Common Name (eg, your name or your server\'s hostname)
  108. commonName_max = 64
  109. name = Name
  110. name_max = 64
  111. emailAddress = Email Address
  112. emailAddress_default = $ENV::KEY_EMAIL
  113. emailAddress_max = 40
  114. # JY -- added for batch mode
  115. organizationalUnitName_default = $ENV::KEY_OU
  116. commonName_default = $ENV::KEY_CN
  117. name_default = $ENV::KEY_NAME
  118. # SET-ex3 = SET extension number 3
  119. [ req_attributes ]
  120. challengePassword = A challenge password
  121. challengePassword_min = 4
  122. challengePassword_max = 20
  123. unstructuredName = An optional company name
  124. [ usr_cert ]
  125. # These extensions are added when 'ca' signs a request.
  126. # This goes against PKIX guidelines but some CAs do it and some software
  127. # requires this to avoid interpreting an end user certificate as a CA.
  128. basicConstraints=CA:FALSE
  129. # Here are some examples of the usage of nsCertType. If it is omitted
  130. # the certificate can be used for anything *except* object signing.
  131. # This is OK for an SSL server.
  132. # nsCertType = server
  133. # For an object signing certificate this would be used.
  134. # nsCertType = objsign
  135. # For normal client use this is typical
  136. # nsCertType = client, email
  137. # and for everything including object signing:
  138. # nsCertType = client, email, objsign
  139. # This is typical in keyUsage for a client certificate.
  140. # keyUsage = nonRepudiation, digitalSignature, keyEncipherment
  141. # This will be displayed in Netscape's comment listbox.
  142. nsComment = "Easy-RSA Generated Certificate"
  143. # PKIX recommendations harmless if included in all certificates.
  144. subjectKeyIdentifier=hash
  145. authorityKeyIdentifier=keyid,issuer:always
  146. extendedKeyUsage=clientAuth
  147. keyUsage = digitalSignature
  148. # This stuff is for subjectAltName and issuerAltname.
  149. # Import the email address.
  150. # subjectAltName=email:copy
  151. subjectAltName=$ENV::KEY_ALTNAMES
  152. # Copy subject details
  153. # issuerAltName=issuer:copy
  154. #nsCaRevocationUrl = http://www.domain.dom/ca-crl.pem
  155. #nsBaseUrl
  156. #nsRevocationUrl
  157. #nsRenewalUrl
  158. #nsCaPolicyUrl
  159. #nsSslServerName
  160. [ server ]
  161. # JY ADDED -- Make a cert with nsCertType set to "server"
  162. basicConstraints=CA:FALSE
  163. nsCertType = server
  164. nsComment = "Easy-RSA Generated Server Certificate"
  165. subjectKeyIdentifier=hash
  166. authorityKeyIdentifier=keyid,issuer:always
  167. extendedKeyUsage=serverAuth
  168. keyUsage = digitalSignature, keyEncipherment
  169. subjectAltName=$ENV::KEY_ALTNAMES
  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:always
  179. # This is what PKIX recommends but some broken software chokes on critical
  180. # extensions.
  181. #basicConstraints = critical,CA:true
  182. # So we do this instead.
  183. basicConstraints = 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. # Some might want this also
  189. # nsCertType = sslCA, emailCA
  190. # Include email address in subject alt name: another PKIX recommendation
  191. # subjectAltName=email:copy
  192. # Copy issuer details
  193. # issuerAltName=issuer:copy
  194. # DER hex encoding of an extension: beware experts only!
  195. # obj=DER:02:03
  196. # Where 'obj' is a standard or added object
  197. # You can even override a supported extension:
  198. # basicConstraints= critical, DER:30:03:01:01:FF
  199. [ crl_ext ]
  200. # CRL extensions.
  201. # Only issuerAltName and authorityKeyIdentifier make any sense in a CRL.
  202. # issuerAltName=issuer:copy
  203. authorityKeyIdentifier=keyid:always,issuer:always
  204. [ engine_section ]
  205. #
  206. # If you are using PKCS#11
  207. # Install engine_pkcs11 of opensc (www.opensc.org)
  208. # And uncomment the following
  209. # verify that dynamic_path points to the correct location
  210. #
  211. #pkcs11 = pkcs11_section
  212. [ pkcs11_section ]
  213. engine_id = pkcs11
  214. dynamic_path = /usr/lib/engines/engine_pkcs11.so
  215. MODULE_PATH = $ENV::PKCS11_MODULE_PATH
  216. PIN = $ENV::PKCS11_PIN
  217. init = 0