Include localhost and hostname in altnames

This commit is contained in:
Jamie Cameron
2022-10-05 17:19:09 -07:00
parent f13d6347a6
commit 57537ef282

View File

@@ -599,7 +599,8 @@ else
openssl version >/dev/null 2>&1
if [ "$?" = "0" ]; then
# We can generate a new SSL key for this host
openssl req -newkey rsa:2048 -x509 -nodes -out $tempdir/cert -keyout $tempdir/key -days 1825 -sha256 >/dev/null 2>&1 <<EOF
echo "subjectAltName=DNS:$host,DNS:localhost" >$tempdir/san.txt
openssl req -newkey rsa:2048 -x509 -nodes -out $tempdir/cert -keyout $tempdir/key -days 1825 -sha256 -extfile $tempdir/san.txt >/dev/null 2>&1 <<EOF
.
.
.
@@ -611,7 +612,7 @@ EOF
if [ "$?" = "0" ]; then
cat $tempdir/cert $tempdir/key >$kfile
fi
rm -f $tempdir/cert $tempdir/key
rm -f $tempdir/cert $tempdir/key $tempdir/san.txt
fi
if [ ! -r $kfile ]; then
# Fall back to the built-in key