Added subj to allow for non-interactive use.

This commit is contained in:
Jeff Alyanak 2019-05-21 10:13:34 -04:00
parent abdc175427
commit 6d7675dcf8
No known key found for this signature in database
GPG Key ID: DD0CB89C105B276F
1 changed files with 1 additions and 1 deletions

View File

@ -10,6 +10,6 @@ command -v openssl >/dev/null 2>&1 || { echo >&2 "openssl required but not found
[ ! -e cert.pfx ] || rm cert.pfx
# Generate new keys
openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.cert -days 36500 -outform DER -passout pass:test
openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.cert -days 36500 -subj '/CN=www.mydom.com/O=My Company Name LTD./C=US' -outform DER -passout pass:test
openssl x509 -inform DER -in cert.cert -out cert.pem
openssl pkcs12 -export -out cert.pfx -inkey key.pem -in cert.pem -passin pass:test -passout pass:test