Last active
December 27, 2015 22:09
-
-
Save kuniyoshi/7397520 to your computer and use it in GitHub Desktop.
Generate self certificated ssl cry. *NOTE*: this file includes `tab`, and `make` will fail when it has been changed `white space`.
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
.PHONY: all install | |
SERVER=purasi-bo.me | |
all: $(SERVER).key $(SERVER).csr $(SERVER).crt install | |
### | |
### *NOTE* | |
### When use this via copy and paste, care command line should starts `tab`. | |
### | |
$(SERVER).key: | |
openssl genrsa -rand /dev/random -des3 -out $@ 2048 | |
$(SERVER).csr: $(SERVER).key | |
openssl req -new -key $< -out $@ | |
$(SERVER).crt: $(SERVER).csr $(SERVER).key | |
openssl x509 -req -days 365 -in $(SERVER).csr -signkey $(SERVER).key -out $@ | |
install: | |
openssl rsa <$(SERVER).key >$(SERVER).key.embedded | |
mv $(SERVER).key.embedded $(SERVER).key |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment