Generate subject alt name in local certificate.

Closes gh-274.
This commit is contained in:
Mark Paluch
2018-07-31 10:09:56 +02:00
parent 380ccc612f
commit c1cfa766f2
2 changed files with 5 additions and 2 deletions

View File

@@ -66,7 +66,9 @@ chmod 400 ${CA_DIR}/private/localhost.key.pem
chmod 400 ${CA_DIR}/private/localhost.decrypted.key.pem
echo "[INFO] Generating server certificate request"
openssl req -config ${DIR}/openssl.cnf \
openssl req -config <(cat ${DIR}/openssl.cnf \
<(printf "\n[SAN]\nsubjectAltName=DNS:localhost,IP:127.0.0.1")) \
-reqexts SAN \
-key ${CA_DIR}/private/localhost.key.pem \
-passin pass:changeit \
-new -sha256 -out ${CA_DIR}/csr/localhost.csr.pem \

View File

@@ -30,6 +30,7 @@ cert_opt = ca_default
default_days = 375
preserve = no
policy = policy_strict
copy_extensions = copy
[ policy_strict ]
# The root CA should only sign intermediate certificates that match.
@@ -103,4 +104,4 @@ nsComment = "OpenSSL Generated Server Certificate"
subjectKeyIdentifier = hash
authorityKeyIdentifier = keyid,issuer:always
keyUsage = critical, digitalSignature, keyEncipherment
extendedKeyUsage = serverAuth
extendedKeyUsage = serverAuth