Create directory structure:
# mkdir /etc/certificateAuthority # cd /etc/certificateAuthority # mkdir certs # mkdir private # chmod 700 private # echo '01' > serial # touch index.txt
Edit /etc/ssl/openssl.cnf:
Change the following properties in the [CA_default] section:
dir = /etc/certificateAuthority new_certs_dir = $dir/certs copy_extensions = copy # Only copy requested # extensions that are not # defined in [usr_cert] default_days = 1825 # certification lasts 5 years policy = policy_anything # Set display options nameopt = ca_default certopt = ca_default
Delete the following properties in the [CA_default] section:
certs = crl_dir = crl =
Change the following properties in the [req_distinguished_name] section as appropriate:
countryName_default = NL stateOrProvinceName_default = Noord Holland localityName_default = Amsterdam 0.organizationName_default = joe.org commonName_default = J. Bloggs emailAddress_default = ca.admin@joe.org
Change the following properties in the [v3_ca] section:
keyUsage = cRLSign, keyCertSign nsCertType = sslCA, emailCA, objCA
Create the certificate authority key:
# openssl genrsa -des3 -out private/cakey.pem 2048Remember the pass phrase! Better yet, since you won't be needing it often (key signing is probably not an every-day activity for you), write it down somewhere safe.
Create the certificate authority's (self-signed) certificate:
# openssl req -new -x509 -key private/cakey.pem -days 1825 -out cacert.pem -outform PEM # cp cacert.pem /etc/ssl/certs
Create a certificate request configuration template:
# cp /etc/ssl/openssl.cnf /etc/ssl/openssl_server_req.template
Remove the following sections:
[ca]
[CA_default]
[policy_match]
[policy_anything]
[usr_cert]
[v3_ca]
[crl_ext]
Change the following properties in the [v3_req] section:
nsCertType = server subjectAltName = @altdns
Change the following properties in the [req] section:
default_bits = 2048 default_keyfile = /etc/ssl/private/SERVER_ID_key.pem encrypt_key = no prompt = no # x509_extensions = v3_ca req_extensions = v3_req
Change the following properties in the [req_distinguished_name] section:
countryName = NL stateOrProvinceName = Noord Holland localityName = Amsterdam organizationName = joe.org commonName = SERVER_NAME emailAddress = SERVER_ID.admin@joe.org
Comment out the following properties in the [req_attributes] section:
# challengePassword = Not needed # unstructuredName =
Add a section [altdns] with the following properties:
DNS.1 = ALT_SERVER_NAME_1 DNS.2 = ALT_SERVER_NAME_2 DNS.3 = ALT_SERVER_NAME_3