Skip to content

Instantly share code, notes, and snippets.

@stiletto
Created February 17, 2015 15:37
Show Gist options
  • Save stiletto/6e4e4d0e4d33d54129b0 to your computer and use it in GitHub Desktop.
Save stiletto/6e4e4d0e4d33d54129b0 to your computer and use it in GitHub Desktop.
Convenient script for StartSSL
# cat dotheshit.sh
#!/bin/sh
NAME=bnw
SIZE=4096
umask 0077
test -f "$NAME.key" || openssl genrsa -out "$NAME.key" "$SIZE"
test -f "$NAME.csr" || ( yes "" | openssl req -new -sha256 -text -key "$NAME.key" -out "$NAME.csr" )
test -f sub.class1.server.ca.pem || wget https://www.startssl.com/certs/sub.class1.server.ca.pem
test -f ca.pem || wget https://www.startssl.com/certs/ca.pem
test -f "$NAME.crt" && test '!' -f "$NAME.txt.crt" && openssl x509 -in "$NAME.crt" -text > "$NAME.txt.crt"
test -f "$NAME.crt" && test '!' -f "$NAME.pem" && cat "$NAME.key" "$NAME.crt" sub.class1.server.ca.pem > "$NAME.pem"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment