From a826762a43e49f33f5be22b2a05ed7b9a1ce3dc6 Mon Sep 17 00:00:00 2001 From: Steve Manuel Date: Tue, 27 Dec 2016 17:49:09 -0800 Subject: add additional cert usage back for testing --- system/tls/devcerts.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'system/tls/devcerts.go') diff --git a/system/tls/devcerts.go b/system/tls/devcerts.go index faa8eb7..8b2f013 100644 --- a/system/tls/devcerts.go +++ b/system/tls/devcerts.go @@ -24,7 +24,6 @@ import ( "net" "os" "path/filepath" - "strings" "time" "github.com/ponzu-cms/ponzu/system/db" @@ -89,11 +88,12 @@ func setupDev() { BasicConstraintsValid: true, } - host := db.ConfigCache("domain") - if host == "" { - host = "localhost, 0.0.0.0" + hosts := []string{"localhost", "0.0.0.0"} + domain := db.ConfigCache("domain") + if domain != "" { + hosts = append(hosts, domain) } - hosts := strings.Split(host, ",") + for _, h := range hosts { if ip := net.ParseIP(h); ip != nil { template.IPAddresses = append(template.IPAddresses, ip) @@ -102,9 +102,10 @@ func setupDev() { } } + hosts = []string{"localhost", "0.0.0.0"} // make all certs CA // template.IsCA = true - // template.KeyUsage |= x509.KeyUsageCertSign + template.KeyUsage |= x509.KeyUsageCertSign derBytes, err := x509.CreateCertificate(rand.Reader, &template, &template, publicKey(priv), priv) if err != nil { -- cgit v1.2.3