+ SAN+="DNS:${altname}, "
+ done
+ SAN="$(printf '%s' "${SAN}" | sed 's/,\s*$//g')"
+ echo " + Generating signing request..."
+ openssl req -new -sha256 -key "certs/${domain}/privkey.pem" -out "certs/${domain}/cert.csr" -subj "/CN=${domain}/" -reqexts SAN -config <(cat /etc/ssl/openssl.cnf <(printf "[SAN]\nsubjectAltName=%s" "${SAN}")) > /dev/null
+
+ # Request and respond to challenges
+ for altname in $altnames; do
+ # Ask the acme-server for new challenge token and extract them from the resulting json block