added config option to set path for openssl config file (currently only used for generating a signing request)

This commit is contained in:
Lukas Schauer
2015-12-07 11:45:09 +01:00
parent cd13a9c21a
commit 474f33d2ca
2 changed files with 3 additions and 1 deletions

View File

@@ -13,6 +13,7 @@ KEYSIZE="4096"
WELLKNOWN=".acme-challenges"
PRIVATE_KEY_RENEW=no
BASEDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
OPENSSL_CNF="$(openssl version -d | cut -d'"' -f2)/openssl.cnf"
# If exists load config from same directory as this script
if [[ -e "${BASEDIR}/config.sh" ]]; then
@@ -131,7 +132,7 @@ sign_domain() {
done
SAN="${SAN%%, }"
echo " + Generating signing request..."
openssl req -new -sha256 -key "${BASEDIR}/certs/${domain}/privkey.pem" -out "${BASEDIR}/certs/${domain}/cert.csr" -subj "/CN=${domain}/" -reqexts SAN -config <(cat /etc/ssl/openssl.cnf <(printf "[SAN]\nsubjectAltName=%s" "${SAN}")) > /dev/null
openssl req -new -sha256 -key "${BASEDIR}/certs/${domain}/privkey.pem" -out "${BASEDIR}/certs/${domain}/cert.csr" -subj "/CN=${domain}/" -reqexts SAN -config <(cat "${OPENSSL_CNF}" <(printf "[SAN]\nsubjectAltName=%s" "${SAN}")) > /dev/null
# Request and respond to challenges
for altname in $altnames; do