1
0

openssl.cnf 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  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::RNDFILE
  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' 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::CA_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/root-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/root-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 # which md to use.
  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_match
  51. # For the CA policy
  52. [ policy_match ]
  53. countryName = match
  54. stateOrProvinceName = match
  55. organizationName = match
  56. organizationalUnitName = optional
  57. commonName = supplied
  58. emailAddress = optional
  59. # For the 'anything' policy
  60. # At this point in time, you must list all acceptable 'object'
  61. # types.
  62. [ policy_anything ]
  63. countryName = optional
  64. stateOrProvinceName = optional
  65. localityName = optional
  66. organizationName = optional
  67. organizationalUnitName = optional
  68. commonName = supplied
  69. emailAddress = optional
  70. ####################################################################
  71. [ req ]
  72. default_bits = $ENV::KEY_SIZE
  73. default_keyfile = privkey.pem
  74. distinguished_name = req_distinguished_name
  75. attributes = req_attributes
  76. x509_extensions = v3_ca # The extentions to add to the self signed cert
  77. # Passwords for private keys if not present they will be prompted for
  78. # input_password = secret
  79. # output_password = secret
  80. # This sets a mask for permitted string types. There are several options.
  81. # default: PrintableString, T61String, BMPString.
  82. # pkix : PrintableString, BMPString.
  83. # utf8only: only UTF8Strings.
  84. # nombstr : PrintableString, T61String (no BMPStrings or UTF8Strings).
  85. # MASK:XXXX a literal mask value.
  86. # WARNING: current versions of Netscape crash on BMPStrings or UTF8Strings
  87. # so use this option with caution!
  88. string_mask = nombstr
  89. # req_extensions = v3_req # The extensions to add to a certificate request
  90. [ req_distinguished_name ]
  91. countryName = Country Name (2 letter code)
  92. countryName_default = $ENV::KEY_COUNTRY
  93. countryName_min = 2
  94. countryName_max = 2
  95. stateOrProvinceName = State or Province Name (full name)
  96. stateOrProvinceName_default = $ENV::KEY_PROVINCE
  97. localityName = Locality Name (eg, city)
  98. localityName_default = $ENV::KEY_CITY
  99. 0.organizationName = Organization Name (eg, company)
  100. 0.organizationName_default = $ENV::KEY_ORG
  101. # we can do this but it is not needed normally :-)
  102. #1.organizationName = Second Organization Name (eg, company)
  103. #1.organizationName_default = World Wide Web Pty Ltd
  104. organizationalUnitName = Organizational Unit Name (eg, section)
  105. #organizationalUnitName_default =
  106. commonName = Common Name (eg, your name or your server\'s hostname)
  107. commonName_default = $ENV::KEY_COMMON
  108. commonName_max = 64
  109. emailAddress = Email Address
  110. emailAddress_default = $ENV::KEY_EMAIL
  111. emailAddress_max = 40
  112. # SET-ex3 = SET extension number 3
  113. [ req_attributes ]
  114. challengePassword = A challenge password
  115. challengePassword_min = 4
  116. challengePassword_max = 20
  117. unstructuredName = An optional company name
  118. [ usr_cert ]
  119. # These extensions are added when 'ca' signs a request.
  120. # This goes against PKIX guidelines but some CAs do it and some software
  121. # requires this to avoid interpreting an end user certificate as a CA.
  122. basicConstraints=CA:FALSE
  123. # Here are some examples of the usage of nsCertType. If it is omitted
  124. # the certificate can be used for anything *except* object signing.
  125. # This is OK for an SSL server.
  126. # nsCertType = server
  127. # For an object signing certificate this would be used.
  128. # nsCertType = objsign
  129. # For normal client use this is typical
  130. # nsCertType = client, email
  131. # and for everything including object signing:
  132. # nsCertType = client, email, objsign
  133. # This is typical in keyUsage for a client certificate.
  134. # keyUsage = nonRepudiation, digitalSignature, keyEncipherment
  135. # This will be displayed in Netscape's comment listbox.
  136. nsComment = "OpenSSL Generated Certificate"
  137. # PKIX recommendations harmless if included in all certificates.
  138. subjectKeyIdentifier=hash
  139. authorityKeyIdentifier=keyid,issuer:always
  140. # This stuff is for subjectAltName and issuerAltname.
  141. # Import the email address.
  142. # subjectAltName=email:copy
  143. # Copy subject details
  144. # issuerAltName=issuer:copy
  145. #nsCaRevocationUrl = http://www.domain.dom/ca-crl.pem
  146. #nsBaseUrl
  147. #nsRevocationUrl
  148. #nsRenewalUrl
  149. #nsCaPolicyUrl
  150. #nsSslServerName
  151. [ v3_req ]
  152. # Extensions to add to a certificate request
  153. basicConstraints = CA:FALSE
  154. keyUsage = nonRepudiation, digitalSignature, keyEncipherment
  155. [ v3_ca ]
  156. # Extensions for a typical CA
  157. # PKIX recommendation.
  158. subjectKeyIdentifier=hash
  159. authorityKeyIdentifier=keyid:always,issuer:always
  160. # This is what PKIX recommends but some broken software chokes on critical
  161. # extensions.
  162. #basicConstraints = critical,CA:true
  163. # So we do this instead.
  164. basicConstraints = CA:true
  165. # Key usage: this is typical for a CA certificate. However since it will
  166. # prevent it being used as an test self-signed certificate it is best
  167. # left out by default.
  168. # keyUsage = cRLSign, keyCertSign
  169. # Some might want this also
  170. # nsCertType = sslCA, emailCA
  171. # Include email address in subject alt name: another PKIX recommendation
  172. # subjectAltName=email:copy
  173. # Copy issuer details
  174. # issuerAltName=issuer:copy
  175. # DER hex encoding of an extension: beware experts only!
  176. # obj=DER:02:03
  177. # Where 'obj' is a standard or added object
  178. # You can even override a supported extension:
  179. # basicConstraints= critical, DER:30:03:01:01:FF
  180. [ crl_ext ]
  181. # CRL extensions.
  182. # Only issuerAltName and authorityKeyIdentifier make any sense in a CRL.
  183. # issuerAltName=issuer:copy
  184. authorityKeyIdentifier=keyid:always,issuer:always