aboutsummaryrefslogtreecommitdiffstats
path: root/certs/Makefile
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2015-12-27 12:29:28 +0100
committerKim Alvefur <zash@zash.se>2015-12-27 12:29:28 +0100
commit0664d7ebf65a3ca356ec80ad4f706919ac745300 (patch)
tree50c569b3a43e2bf21301dba4606a02940a6ed127 /certs/Makefile
parentb3d8c070f940572d53e8bea734a7abef38411c56 (diff)
parentb50935a87c03246fac1541b275da4464a5b63b3b (diff)
downloadprosody-0664d7ebf65a3ca356ec80ad4f706919ac745300.tar.gz
prosody-0664d7ebf65a3ca356ec80ad4f706919ac745300.zip
Merge 0.10->trunk
Diffstat (limited to 'certs/Makefile')
-rw-r--r--certs/Makefile42
1 files changed, 37 insertions, 5 deletions
diff --git a/certs/Makefile b/certs/Makefile
index f3854c5f..96361748 100644
--- a/certs/Makefile
+++ b/certs/Makefile
@@ -15,16 +15,48 @@ 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 -key $^ -days 365 -sha256 -utf8 -subj /CN=$* -out $@
+
+%.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 > $@
%.key:
- openssl genrsa $(keysize) > $@
- @chmod 400 $@
+ umask 0077 && openssl genrsa -out $@ $(keysize)
+ @chmod 400 $@ -c