Pass PKCS12_PASSWORD option to 50-config

This commit is contained in:
beredim 2022-07-06 17:42:21 +03:00 committed by GitHub
parent 1f42c02a4a
commit 98ab2f7940
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -353,7 +353,11 @@ if [ ! -f "/config/keys/letsencrypt/fullchain.pem" ]; then
fi fi
sleep infinity sleep infinity
fi fi
openssl pkcs12 -export -out privkey.pfx -inkey privkey.pem -in cert.pem -certfile chain.pem -passout pass: if [[ -z "${PKCS12_PASSWORD}" ]]; then
openssl pkcs12 -export -out privkey.pfx -inkey privkey.pem -in cert.pem -certfile chain.pem -passout pass:
else
openssl pkcs12 -export -out privkey.pfx -inkey privkey.pem -in cert.pem -certfile chain.pem -passout pass:"${PKCS12_PASSWORD}"
fi
sleep 1 sleep 1
cat {privkey,fullchain}.pem > priv-fullchain-bundle.pem cat {privkey,fullchain}.pem > priv-fullchain-bundle.pem
echo "New certificate generated; starting nginx" echo "New certificate generated; starting nginx"