jetforce/generate_ssl_cert

10 lines
239 B
Bash
Executable File

#!/usr/bin/env bash
domain=${1:-localhost}
echo "Generating ad-hoc SSL certificate for domain '${domain}'"
openssl req \
-newkey rsa:2048 -nodes -keyout ${domain}.key \
-nodes -x509 -out ${domain}.crt \
-subj "/CN=${domain}"