Working with app and Add CA
Tested with the EcoVacs app, almost everything works. CA Added for managing certs. A self-signed may work as well. TBD
This commit is contained in:
parent
58e7ce0653
commit
98068046e9
23 changed files with 895 additions and 154 deletions
180
certs/CA/openssl.cnf
Normal file
180
certs/CA/openssl.cnf
Normal file
|
|
@ -0,0 +1,180 @@
|
|||
HOME = .
|
||||
RANDFILE = $ENV::HOME/.rnd
|
||||
|
||||
####################################################################
|
||||
# CA Definition
|
||||
[ ca ]
|
||||
default_ca = CA_default # The default ca section
|
||||
|
||||
####################################################################
|
||||
# Per the above, this is where we define CA values
|
||||
[ CA_default ]
|
||||
|
||||
dir = . # Where everything is kept
|
||||
certs = $dir/certsdb # Where the issued certs are kept
|
||||
new_certs_dir = $certs # default place for new certs.
|
||||
database = $dir/index.txt # database index file.
|
||||
certificate = $dir/cacert.pem # The CA certificate
|
||||
private_key = $dir/private/cakey.pem# The private key
|
||||
serial = $dir/serial # The current serial number
|
||||
RANDFILE = $dir/private/.rand # private random number file
|
||||
|
||||
crldir = $dir/crl
|
||||
crlnumber = $dir/crlnumber # the current crl number
|
||||
crl = $crldir/crl.pem # The current CRL
|
||||
|
||||
# By default we use "user certificate" extensions when signing
|
||||
x509_extensions = usr_cert # The extentions to add to the cert
|
||||
|
||||
# Honor extensions requested of us
|
||||
copy_extensions = copy
|
||||
|
||||
# Comment out the following two lines for the "traditional"
|
||||
# (and highly broken) format.
|
||||
name_opt = ca_default # Subject Name options
|
||||
cert_opt = ca_default # Certificate field options
|
||||
|
||||
# Extensions to add to a CRL. Note: Netscape communicator chokes on V2 CRLs
|
||||
# so this is commented out by default to leave a V1 CRL.
|
||||
# crlnumber must also be commented out to leave a V1 CRL.
|
||||
#crl_extensions = crl_ext
|
||||
default_days = 3650 # how long to certify for
|
||||
default_crl_days= 30 # how long before next CRL
|
||||
default_md = sha1 # which md to use.
|
||||
preserve = no # keep passed DN ordering
|
||||
|
||||
# A few difference way of specifying how similar the request should look
|
||||
# For type CA, the listed attributes must be the same, and the optional
|
||||
# and supplied fields are just that :-)
|
||||
policy = policy_anything
|
||||
|
||||
####################################################################
|
||||
# The default policy for the CA when signing requests, requires some
|
||||
# resemblence to the CA cert
|
||||
#
|
||||
[ policy_match ]
|
||||
countryName = match # Must be the same as the CA
|
||||
stateOrProvinceName = match # Must be the same as the CA
|
||||
organizationName = match # Must be the same as the CA
|
||||
organizationalUnitName = optional # not required
|
||||
commonName = supplied # must be there, whatever it is
|
||||
emailAddress = optional # not required
|
||||
|
||||
####################################################################
|
||||
# An alternative policy not referred to anywhere in this file. Can
|
||||
# be used by specifying '-policy policy_anything' to ca(8).
|
||||
#
|
||||
[ policy_anything ]
|
||||
countryName = optional
|
||||
stateOrProvinceName = optional
|
||||
localityName = optional
|
||||
organizationName = optional
|
||||
organizationalUnitName = optional
|
||||
commonName = supplied
|
||||
emailAddress = optional
|
||||
|
||||
####################################################################
|
||||
# This is where we define how to generate CSRs
|
||||
[ req ]
|
||||
default_bits = 2048
|
||||
default_keyfile = privkey.pem
|
||||
distinguished_name = req_distinguished_name # where to get DN for reqs
|
||||
attributes = req_attributes # req attributes
|
||||
x509_extensions = v3_ca # The extentions to add to self signed certs
|
||||
req_extensions = v3_req # The extensions to add to req's
|
||||
prompt = no
|
||||
|
||||
# This sets a mask for permitted string types. There are several options.
|
||||
# default: PrintableString, T61String, BMPString.
|
||||
# pkix : PrintableString, BMPString.
|
||||
# utf8only: only UTF8Strings.
|
||||
# nombstr : PrintableString, T61String (no BMPStrings or UTF8Strings).
|
||||
# MASK:XXXX a literal mask value.
|
||||
# WARNING: current versions of Netscape crash on BMPStrings or UTF8Strings
|
||||
# so use this option with caution!
|
||||
string_mask = nombstr
|
||||
|
||||
|
||||
####################################################################
|
||||
# Per "req" section, this is where we define DN info
|
||||
[ req_distinguished_name ]
|
||||
countryName = Country Name (2 letter code)
|
||||
countryName_default = US
|
||||
countryName_min = 2
|
||||
countryName_max = 2
|
||||
|
||||
stateOrProvinceName = State or Province Name (full name)
|
||||
stateOrProvinceName_default = California
|
||||
|
||||
localityName = Locality Name (eg, city)
|
||||
localityName_default = Hawthorne
|
||||
|
||||
0.organizationName = Organization Name (eg, company)
|
||||
0.organizationName_default = PhilNet
|
||||
|
||||
organizationalUnitName = Organizational Unit Name (eg, section)
|
||||
|
||||
commonName = Common Name (eg, YOUR name)
|
||||
commonName_max = 64
|
||||
|
||||
emailAddress = Email Address
|
||||
emailAddress_max = 64
|
||||
|
||||
|
||||
####################################################################
|
||||
# We don't want these, but the section must exist
|
||||
[ req_attributes ]
|
||||
#challengePassword = A challenge password
|
||||
#challengePassword_min = 4
|
||||
#challengePassword_max = 20
|
||||
#unstructuredName = An optional company name
|
||||
|
||||
|
||||
|
||||
####################################################################
|
||||
[ v3_req ]
|
||||
keyUsage=critical,digitalSignature,keyEncipherment
|
||||
extendedKeyUsage=critical,serverAuth,clientAuth
|
||||
basicConstraints=critical,CA:false
|
||||
subjectAltName = @alt_names
|
||||
[ alt_names ]
|
||||
DNS.0 = *.ecouser.net
|
||||
DNS.1 = *.ecovacs.com
|
||||
|
||||
####################################################################
|
||||
# Extensions for when we sign normal certs (specified as default)
|
||||
[ usr_cert ]
|
||||
basicConstraints = CA:false
|
||||
subjectKeyIdentifier = hash
|
||||
authorityKeyIdentifier = keyid,issuer
|
||||
subjectAltName = @alt_names
|
||||
[ alt_names ]
|
||||
DNS.0 = *.ecouser.net
|
||||
DNS.1 = *.ecovacs.com
|
||||
|
||||
####################################################################
|
||||
# Same as above, but cert req already has SubjectAltName
|
||||
[ usr_cert_has_san ]
|
||||
basicConstraints = CA:false
|
||||
subjectKeyIdentifier = hash
|
||||
authorityKeyIdentifier = keyid,issuer
|
||||
subjectAltName = @alt_names
|
||||
[ alt_names ]
|
||||
DNS.0 = *.ecouser.net
|
||||
DNS.1 = *.ecovacs.com
|
||||
|
||||
####################################################################
|
||||
# Extensions to use when signing a CA
|
||||
[ v3_ca ]
|
||||
subjectKeyIdentifier = hash
|
||||
authorityKeyIdentifier = keyid:always,issuer:always
|
||||
basicConstraints = CA:true
|
||||
subjectAltName=email:move
|
||||
|
||||
####################################################################
|
||||
# Same as above, but CA req already has SubjectAltName
|
||||
[ v3_ca_has_san ]
|
||||
subjectKeyIdentifier = hash
|
||||
authorityKeyIdentifier = keyid:always,issuer:always
|
||||
basicConstraints = CA:true
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue