Copy /System/Library/OpenSSL/openssl.cnf
to a new file.
Add the following at the end:
[ req ]
req_extensions = v3_req
[ v3_req ]
# Extensions to add to a certificate request
basicConstraints = CA:FALSE
keyUsage = nonRepudiation, digitalSignature, keyEncipherment
subjectAltName = @alt_names
[alt_names]
Then under alt_names
list the DNS names, like:
DNS.1=*.osscf.cfwidgets.com
DNS.2=*.uaa.osscf.cfwidgets.com
DNS.3=*.login.osscf.cfwidgets.com
Generate private key
openssl genrsa 2048 > gcp.key
Generate the CSR based on the private key
openssl req -new -sha256 -key gcp.key -subj "/C=US/ST=CA/O=Acme, Inc./CN=osscf.cfwidgets.com" -reqexts v3_req -config openssl.cnf -out osscf.csr
Generate SSL certificate
openssl x509 -req -sha256 -days 365 -in osscf.csr -signkey gcp.key -out osscf.crt