Software /
code /
prosody
Diff
certs/Makefile @ 7028:7d0ce5e6a6d3
certs/Makefile: Add targets for any combination of already existing config, key file
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Wed, 23 Dec 2015 12:10:26 +0100 |
parent | 5293:fe9215155453 |
child | 7031:89221daefae9 |
line wrap: on
line diff
--- a/certs/Makefile Wed Dec 23 09:00:03 2015 +0100 +++ b/certs/Makefile Wed Dec 23 12:10:26 2015 +0100 @@ -15,13 +15,46 @@ # To request a cert %.csr: %.cnf %.key - openssl req -new -key $(lastword $^) -out $@ -utf8 -config $(firstword $^) + openssl req -new -key $(lastword $^) \ + -sha256 -utf8 -config $(firstword $^) -out $@ + +%.csr: %.cnf + umask 0077 && touch $*.key + openssl req -new -newkey rsa:$(keysize) -nodes -keyout $*.key \ + -sha256 -utf8 -config $^ -out $@ + @chmod 400 $*.key -c + +%.csr: %.key + openssl req -new -key $^ -utf8 -subj /CN=$* -out $@ + +%.csr: + umask 0077 && touch $*.key + openssl req -new -newkey rsa:$(keysize) -nodes -keyout $*.key \ + -utf8 -subj /CN=$* -out $@ + @chmod 400 $*.key -c # Self signed %.crt: %.cnf %.key - openssl req -new -x509 -nodes -key $(lastword $^) -days 365 \ - -sha1 -out $@ -utf8 -config $(firstword $^) + openssl req -new -x509 -key $(lastword $^) -days 365 -sha256 -utf8 \ + -config $(firstword $^) -out $@ + +%.crt: %.cnf + umask 0077 && touch $*.key + openssl req -new -x509 -newkey rsa:$(keysize) -nodes -keyout $*.key \ + -days 365 -sha256 -utf8 -config $(firstword $^) -out $@ + @chmod 400 $*.key -c +%.crt: %.key + openssl req -new -x509 -nodes -key $^ -days 365 \ + -sha256 -out $@ -utf8 -config $(firstword $^) + +%.crt: + umask 0077 && touch $*.key + openssl req -new -x509 -newkey rsa:$(keysize) -nodes -keyout $*.key \ + -days 365 -sha256 -out $@ -utf8 -subj /CN=$* + @chmod 400 $*.key -c + +# Generate a config from the example %.cnf: sed 's,example\.com,$*,g' openssl.cnf > $@