Skip to content

Instantly share code, notes, and snippets.

@blha303
Created February 16, 2016 17:43
Show Gist options
  • Save blha303/59ffbe99696e19511762 to your computer and use it in GitHub Desktop.
Save blha303/59ffbe99696e19511762 to your computer and use it in GitHub Desktop.
Generate a CSR for a domain
#!/bin/bash
openssl rsa -in account.key -pubout 2>&1 | grep -v "writing"
echo "press enter..." >&2
read enter
openssl req -new -sha256 -key domain.key -subj "/" \
-reqexts SAN -config <(cat /etc/ssl/openssl.cnf \
<(printf "[SAN]\nsubjectAltName=DNS:$1"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment