4 ## ./gencsr KEY.key DOMAIN1 DOMAIN2
5 ## Generate (to stdout) a CSR for this key, for all the domains listed later
10 test -f "$KEY" || (echo "Usage: $0 KEY.key DOMAIN1 DOMAIN2"; exit 1)
12 openssl req -new -sha256 -key "$KEY" -subj "/" -reqexts SAN \
13 -config <(cat /etc/ssl/openssl.cnf \
14 <(echo "[SAN]"; echo -n "subjectAltName="; unset COMMA; \
15 for domain in "$@"; do test -n "$COMMA" && echo -n ","; echo -n "DNS:$domain"; COMMA=1; done; echo) \