1
0

root-ca.cnf 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. # Based on: https://www.feistyduck.com/library/openssl-cookbook/online/openssl-command-line/private-ca-creating-root.html
  2. [default]
  3. name = root-ca
  4. default_ca = ca_default
  5. name_opt = utf8,esc_ctrl,multiline,lname,align
  6. [ca_dn]
  7. countryName = "GB"
  8. organizationName = "Example"
  9. commonName = "Root CA"
  10. [ca_default]
  11. home = ./${ENV::CA_PATH}
  12. database = $home/db/index
  13. serial = $home/db/serial
  14. certificate = ./${ENV::CRT_PATH}/$name.crt
  15. private_key = ./${ENV::KEY_PATH}/$name.key
  16. RANDFILE = $home/private/random
  17. new_certs_dir = $home/certificates
  18. unique_subject = no
  19. copy_extensions = none
  20. default_days = 3650
  21. default_md = sha256
  22. policy = policy_cn_supplied
  23. [policy_cn_supplied]
  24. countryName = optional
  25. stateOrProvinceName = optional
  26. organizationName = optional
  27. organizationalUnitName = optional
  28. commonName = supplied
  29. emailAddress = optional
  30. [req]
  31. default_bits = 4096
  32. encrypt_key = yes
  33. default_md = sha256
  34. utf8 = yes
  35. string_mask = utf8only
  36. prompt = no
  37. distinguished_name = ca_dn
  38. req_extensions = ca_ext
  39. [ca_ext]
  40. basicConstraints = critical,CA:true
  41. keyUsage = critical,keyCertSign
  42. subjectKeyIdentifier = hash
  43. nameConstraints = @name_constraints
  44. [server_ext]
  45. authorityKeyIdentifier = keyid:always
  46. basicConstraints = critical,CA:false
  47. extendedKeyUsage = clientAuth,serverAuth
  48. keyUsage = critical,digitalSignature,keyEncipherment
  49. subjectKeyIdentifier = hash
  50. [client_ext]
  51. authorityKeyIdentifier = keyid:always
  52. basicConstraints = critical,CA:false
  53. extendedKeyUsage = clientAuth
  54. keyUsage = critical,digitalSignature
  55. subjectKeyIdentifier = hash
  56. [name_constraints]
  57. permitted;DNS.0=localhost
  58. permitted;IP.0=127.0.0.1/255.0.0.0
  59. permitted;IP.1=::1/ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff