summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorMagnus Ahltorp <map@kth.se>2015-03-31 15:23:12 +0200
committerMagnus Ahltorp <map@kth.se>2015-03-31 15:23:12 +0200
commit064556bd0e531c71dd285de372312d2851abf29f (patch)
tree94b6e41e85d3a152f284b32b0631512124e53bff /Makefile
parent6b62ebbf1de5b9e55b04e9cfafd0620f1374c2d4 (diff)
X.509 cert generation for http server
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile28
1 files changed, 27 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 261def1..d7b5ee3 100644
--- a/Makefile
+++ b/Makefile
@@ -9,13 +9,14 @@ release: all
mkdir $(RELDIR)
./makerelease.erl
mkdir $(RELDIR)/catlfish
- cp -r webroot $(RELDIR)/catlfish
-include test/test.mk
tests-prepare:
rm -r $(RELDIR)/tests || true
mkdir $(RELDIR)/tests
+ make tests-createca
+ make tests-createcert
mkdir $(RELDIR)/tests/keys
(cd $(RELDIR)/tests/keys ; ../../../tools/create-key.sh logkey)
mkdir $(RELDIR)/tests/mergedb
@@ -90,6 +91,31 @@ tests:
@make tests-wait
@make tests-stop
+tests-createca:
+ mkdir $(RELDIR)/tests/httpsca
+ ( cd $(RELDIR)/tests/httpsca ; \
+ mkdir -p demoCA/newcerts ; \
+ touch demoCA/index.txt ; \
+ echo 00 > demoCA/serial ; \
+ echo '[ req ]' > caconfig.txt ; \
+ echo 'distinguished_name = req_distinguished_name' >> caconfig.txt ; \
+ echo 'x509_extensions = v3_ca' >> caconfig.txt ; \
+ echo '[ req_distinguished_name ]' >> caconfig.txt ; \
+ echo '[ v3_ca ]' >> caconfig.txt ; \
+ echo 'basicConstraints=CA:true' >> caconfig.txt ; \
+ openssl req -newkey rsa:2048 -keyout key.pem -out req.csr -nodes -subj '/countryName=SE/stateOrProvinceName=Stockholm/organizationName=Test/commonName=ca/O=ca' -config caconfig.txt ; \
+ openssl ca -in req.csr -selfsign -keyfile key.pem -out demoCA/cacert.pem -batch \
+ )
+
+tests-createcert:
+ mkdir $(RELDIR)/tests/httpscert
+ openssl req -new -newkey rsa:2048 -keyout $(RELDIR)/tests/httpscert/httpskey-1.pem -out $(RELDIR)/tests/httpsca/httpscert-1.csr -nodes -subj '/countryName=SE/stateOrProvinceName=Stockholm/organizationName=Test/CN=localhost'
+ ( cd $(RELDIR)/tests/httpsca ; \
+ openssl ca -in httpscert-1.csr -keyfile key.pem -out httpscert-1.pem -batch \
+ )
+ cp $(RELDIR)/tests/httpsca/httpscert-1.pem $(RELDIR)/tests/httpscert/
+
+
# Unit testing.
check: all
test/check.erl