Advertisement
Guest User

(Building an OpenSSL Certificate Authority - Creating ECC Certificates - openssl_server.cnf

a guest
Sep 3rd, 2022
100
1
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 4.65 KB | Source Code | 1 0
  1. # OpenSSL Server Default configuration file
  2. # Copy to /root/ca/intermediary/openssl_server.cnf
  3. # https://community.f5.com/t5/technical-articles/building-an-openssl-certificate-authority-creating-ecc/ta-p/279468
  4. # Missing openssl_server.cnf from the community.f5.com article about Building an OpenSSL Certificate Authority - Creating ECC Certificates
  5.  
  6. [ ca ]
  7. default_ca = CA_default
  8.  
  9. [ CA_default ]
  10. # Directory and file locations.
  11. dir               = /root/ca/intermediate
  12. certs             = $dir/certs
  13. crl_dir           = $dir/crl
  14. new_certs_dir     = $dir/certs
  15. database          = $dir/index.txt
  16. serial            = $dir/serial
  17. RANDFILE          = $dir/private/.rand
  18.  
  19. # The root key and root certificate.
  20. private_key       = $dir/private/int.cheese.key.pem
  21. certificate       = $dir/certs/int.cheese.crt.pem
  22.  
  23. # For certificate revocation lists.
  24. crlnumber         = $dir/crlnumber
  25. crl               = $dir/crl/whomovedmycheese.crl
  26. crl_extensions    = crl_ext
  27. default_crl_days  = 180
  28.  
  29. # SHA-1 is deprecated, so use SHA-2 or SHA-3 instead.
  30. default_md        = sha384
  31.  
  32. name_opt          = ca_default
  33. cert_opt          = ca_default
  34. default_days      = 3000
  35. preserve          = no
  36. policy            = policy_loose
  37.  
  38. [ policy_loose ]
  39. # Allow the intermediate CA to sign a more diverse range of certificates.
  40. # See the POLICY FORMAT section of the `ca` man page.
  41. countryName             = optional
  42. stateOrProvinceName     = optional
  43. localityName            = optional
  44. organizationName        = optional
  45. organizationalUnitName  = optional
  46. commonName              = supplied
  47. emailAddress            = optional
  48.  
  49. [ req ]
  50. # Options for the `req` tool (`man req`).
  51. default_bits        = 2048
  52. distinguished_name  = req_distinguished_name
  53. string_mask         = utf8only
  54.  
  55. # SHA-1 is deprecated, so use SHA-2 or SHA-3 instead.
  56. default_md          = sha384
  57.  
  58. # Extension to add when the -x509 option is used.
  59. x509_extensions     = v3_ca
  60.  
  61. [ req_distinguished_name ]
  62. countryName                     = Country Name (2 letter code)
  63. stateOrProvinceName             = State or Province Name
  64. localityName                    = Locality Name
  65. 0.organizationName              = Organization Name
  66. organizationalUnitName          = Organizational Unit Name
  67. commonName                      = Common Name
  68. emailAddress                    = Email Address
  69.  
  70. # Optionally, specify some defaults.
  71. countryName_default             = US
  72. stateOrProvinceName_default     = WA
  73. localityName_default            = Seattle
  74. 0.organizationName_default      = Grilled Cheese Inc.
  75. organizationalUnitName_default  = Grilled Cheese Intermediary CA
  76. emailAddress_default            = grilledcheese@yummyinmytummy.us
  77.  
  78. [ v3_ca ]
  79. # Extensions for a typical CA (`man x509v3_config`).
  80. subjectKeyIdentifier = hash
  81. authorityKeyIdentifier = keyid:always,issuer
  82. basicConstraints = critical, CA:true
  83. keyUsage = critical, digitalSignature, cRLSign, keyCertSign
  84.  
  85. [ v3_intermediate_ca ]
  86. # Extensions for a typical intermediate CA (`man x509v3_config`).
  87. subjectKeyIdentifier = hash
  88. authorityKeyIdentifier = keyid:always,issuer
  89. basicConstraints = critical, CA:true, pathlen:0
  90. keyUsage = critical, digitalSignature, cRLSign, keyCertSign
  91. crlDistributionPoints = @crl_info
  92. authorityInfoAccess = @ocsp_info
  93.  
  94. [ usr_cert ]
  95. # Extensions for client certificates (`man x509v3_config`).
  96. basicConstraints = CA:FALSE
  97. nsCertType = client, email
  98. nsComment = "OpenSSL Generated Client Certificate"
  99. subjectKeyIdentifier = hash
  100. authorityKeyIdentifier = keyid,issuer
  101. keyUsage = critical, nonRepudiation, digitalSignature, keyEncipherment
  102. extendedKeyUsage = clientAuth, emailProtection
  103.  
  104. [ server_cert ]
  105. # Extensions for server certificates (`man x509v3_config`).
  106. basicConstraints = CA:FALSE
  107. nsCertType = server
  108. nsComment = "Grilled Cheese Generated Server Certificate"
  109. subjectKeyIdentifier = hash
  110. authorityKeyIdentifier = keyid,issuer:always
  111. keyUsage = critical, digitalSignature, keyEncipherment
  112. extendedKeyUsage = serverAuth
  113. crlDistributionPoints = @crl_info
  114. authorityInfoAccess = @ocsp_info
  115. subjectAltName = @alt_names
  116.  
  117. [alt_names]
  118. DNS.0 = CN Name Here
  119. DNS.1 = Whatever else here
  120.  
  121. [ crl_ext ]
  122. # Extension for CRLs (`man x509v3_config`).
  123. authorityKeyIdentifier=keyid:always
  124.  
  125. [ ocsp ]
  126. # Extension for OCSP signing certificates (`man ocsp`).
  127. basicConstraints = CA:FALSE
  128. subjectKeyIdentifier = hash
  129. authorityKeyIdentifier = keyid,issuer
  130. keyUsage = critical, digitalSignature
  131. extendedKeyUsage = critical, OCSPSigning
  132.  
  133. [crl_info]
  134. URI.0 = http://crl.grilledcheese.us/whomovedmycheese.crl
  135.  
  136. [ocsp_info]
  137. caIssuers;URI.0 = http://ocsp.grilledcheese.us/cheddarcheeseroot.crt
  138. OCSP;URI.0 = http://ocsp.grilledcheese.us/
  139.  
  140.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement