diff options
author | Steve Manuel <nilslice@gmail.com> | 2016-12-27 17:49:09 -0800 |
---|---|---|
committer | Steve Manuel <nilslice@gmail.com> | 2016-12-27 17:49:09 -0800 |
commit | a826762a43e49f33f5be22b2a05ed7b9a1ce3dc6 (patch) | |
tree | 159ed0b4c6eb04c3a95082fa60f0df12fe2eeb53 /system/tls/devcerts.go | |
parent | 5155e01f53d90a4bc22550add28fd50035a9e202 (diff) |
add additional cert usage back for testing
Diffstat (limited to 'system/tls/devcerts.go')
-rw-r--r-- | system/tls/devcerts.go | 13 |
1 files changed, 7 insertions, 6 deletions
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 { |