summaryrefslogtreecommitdiff
path: root/test/simple-ca/Makefile
diff options
context:
space:
mode:
authorkali kaneko (leap communications) <kali@leap.se>2020-02-24 20:11:30 +0100
committerkali kaneko (leap communications) <kali@leap.se>2020-02-24 20:11:30 +0100
commitdf71e42ec9337020874486ac9ad94e931781a1be (patch)
tree9567f4aae48190fce84360c3c1d40c4b0af5fc5e /test/simple-ca/Makefile
parenta0bc2768c04255e13ef87798d87e4916d7bf17fc (diff)
[tests] add config files for ca and certs
Diffstat (limited to 'test/simple-ca/Makefile')
-rw-r--r--test/simple-ca/Makefile35
1 files changed, 25 insertions, 10 deletions
diff --git a/test/simple-ca/Makefile b/test/simple-ca/Makefile
index 122f08b..9249e90 100644
--- a/test/simple-ca/Makefile
+++ b/test/simple-ca/Makefile
@@ -2,27 +2,42 @@ CERTTOOL=certtool
CAKEY=ca-key.pem
CATEMPL=ca.cfg
SRVTEMPL=server-cert.cfg
-DEPLOY=certs
+DEPLOY=certificates
+TLS=tls
+VPN=vpn
+SIP=sip2
usage:
- @echo "Use 'make ca' for creating a new disposable ca, or 'make cert' for creating a new cert"
+ @echo "Use 'make ca' for creating a new disposable ca, or 'make certs' for creating new certs for services"
clean:
- rm -f tls-key.pem tls-cert.pem ca-key.pem ca.crt request.pem
+ rm -f $(TLS)-key.pem $(TLS)-cert.pem $(VPN)-key.pem $(VPN)-cert.pem $(SIP)-key.pem $(SIP)-cert.pem ca-key.pem ca.crt request.pem
ca:
$(CERTTOOL) --generate-privkey --outfile $(CAKEY)
$(CERTTOOL) --generate-self-signed --load-privkey ca-key.pem --outfile ca.crt --template $(CATEMPL)
-cert:
- $(CERTTOOL) --generate-privkey --outfile tls-key.pem --template $(SRVTEMPL)
- $(CERTTOOL) --generate-request --load-privkey tls-key.pem --outfile request.pem --template $(SRVTEMPL)
- $(CERTTOOL) --generate-certificate --load-privkey tls-key.pem \
- --template $(SRVTEMPL) --outfile tls-cert.pem \
+certs:
+ $(CERTTOOL) --generate-privkey --outfile $(TLS)-key.pem --template $(SRVTEMPL)
+ $(CERTTOOL) --generate-request --load-privkey $(TLS)-key.pem --outfile request.pem --template $(SRVTEMPL)
+ $(CERTTOOL) --generate-certificate --load-privkey $(TLS)-key.pem \
+ --template $(SRVTEMPL) --outfile $(TLS)-cert.pem \
--load-ca-certificate ca.crt --load-ca-privkey $(CAKEY)
+ @rm request.pem
+ $(CERTTOOL) --generate-privkey --outfile $(SIP)-key.pem --template $(SRVTEMPL)
+ $(CERTTOOL) --generate-request --load-privkey $(SIP)-key.pem --outfile request.pem --template $(SRVTEMPL)
+ $(CERTTOOL) --generate-certificate --load-privkey $(SIP)-key.pem \
+ --template $(SRVTEMPL) --outfile $(SIP)-cert.pem \
+ --load-ca-certificate ca.crt --load-ca-privkey $(CAKEY)
+ @rm request.pem
+ $(CERTTOOL) --generate-privkey --outfile $(VPN)-key.pem --template $(SRVTEMPL)
+ $(CERTTOOL) --generate-request --load-privkey $(VPN)-key.pem --outfile request.pem --template $(SRVTEMPL)
+ $(CERTTOOL) --generate-certificate --load-privkey $(VPN)-key.pem \
+ --template $(SRVTEMPL) --outfile $(VPN)-cert.pem \
+ --load-ca-certificate ca.crt --load-ca-privkey $(CAKEY)
+ @rm request.pem
deploy:
@rm -rf $(DEPLOY)
@mkdir $(DEPLOY)
- @cp ca.crt tls-key.pem tls-cert.pem $(DEPLOY)
+ cp ca.crt $(TLS)-key.pem $(TLS)-cert.pem $(VPN)-cert.pem $(VPN)-key.pem $(SIP)-cert.pem $(SIP)-key.pem $(DEPLOY)
@echo "done"
-