Created
February 17, 2015 15:37
-
-
Save stiletto/6e4e4d0e4d33d54129b0 to your computer and use it in GitHub Desktop.
Convenient script for StartSSL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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