aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2015-12-23 12:10:26 +0100
committerKim Alvefur <zash@zash.se>2015-12-23 12:10:26 +0100
commitea6ee08b09ea25fbce5c6bfb0138a3488cdbb256 (patch)
treedb6c269eb3634d65625047181f7ef9e0fc1b8d80
parent8bef48f7a9b6041b3ff5c8704139d8bbbd6b614a (diff)
downloadprosody-ea6ee08b09ea25fbce5c6bfb0138a3488cdbb256.tar.gz
prosody-ea6ee08b09ea25fbce5c6bfb0138a3488cdbb256.zip
certs/Makefile: Add targets for any combination of already existing config, key file
-rw-r--r--certs/Makefile39
1 files changed, 36 insertions, 3 deletions
diff --git a/certs/Makefile b/certs/Makefile
index f3854c5f..6ffb6bd7 100644
--- a/certs/Makefile
+++ b/certs/Makefile
@@ -15,13 +15,46 @@ keysize=2048
# 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 > $@