Commit 9002db2a authored by Matthew Holt's avatar Matthew Holt

letsencrypt: Remote duplicate hosts from certificate request

Domain names must be unique in cert bundle request or really bad things happen (like, um, a panic)
parent 19c6bbf6
...@@ -79,9 +79,19 @@ func Activate(configs []server.Config) ([]server.Config, error) { ...@@ -79,9 +79,19 @@ func Activate(configs []server.Config) ([]server.Config, error) {
} }
// little bit of housekeeping; gather the hostnames into a slice // little bit of housekeeping; gather the hostnames into a slice
hosts := make([]string, len(cfgIndexes)) var hosts []string
for i, idx := range cfgIndexes { for _, idx := range cfgIndexes {
hosts[i] = configs[idx].Host // don't allow duplicates (happens when serving same host on multiple ports!)
var duplicate bool
for _, otherHost := range hosts {
if configs[idx].Host == otherHost {
duplicate = true
break
}
}
if !duplicate {
hosts = append(hosts, configs[idx].Host)
}
} }
// client is ready, so let's get free, trusted SSL certificates! // client is ready, so let's get free, trusted SSL certificates!
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment