Skip to content

Instantly share code, notes, and snippets.

@bentglasstube
Last active August 29, 2015 13:57
Show Gist options
  • Save bentglasstube/9417688 to your computer and use it in GitHub Desktop.
Save bentglasstube/9417688 to your computer and use it in GitHub Desktop.
Makefile for making certificates with openssl
BITSIZE=4096
FILE=server
$(FILE).crt: $(FILE).csr
@echo "Copy and paste the following into your CA:"
@cat $(FILE).csr
@echo "Paste the certificate from your CA here (^D to finish):"
@cat >$(FILE).crt
rm $(FILE).csr
$(FILE).csr: $(FILE).key
openssl req -new -key $(FILE).key -out $(FILE).csr
$(FILE).key:
openssl genrsa -des3 -passout pass:x -out $(FILE).pass.key $(BITSIZE)
openssl rsa -passin pass:x -in $(FILE).pass.key -out $(FILE).key
rm $(FILE).pass.key
clean:
rm $(FILE).*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment