$NetBSD: patch-certs_makefile,v 1.1 2020/03/09 19:37:20 khorben Exp $

Also generate localhost.cnf

--- certs/makefile.orig	2020-01-02 09:49:37.000000000 +0000
+++ certs/makefile
@@ -12,7 +12,12 @@ keysize=2048
 # to generate a self signed certificate.
 
 ${.TARGETS:M*.crt}: 
+	$(MAKE) ${.TARGET:R}.cnf
 	openssl req -new -x509 -newkey rsa:$(keysize) -nodes -keyout ${.TARGET:R}.key \
 		-days 365 -sha256 -out $@ -utf8 -subj /CN=${.TARGET:R}
 
+# Generate a config from the example
+${.TARGETS:M*.cnf}:
+	sed 's,example\.com,$*,g' openssl.cnf > $@
+
 .SUFFIXES: .key .crt
