Merge pull request #2704 from MDrollette/multiple-opts

config: allow adding multiple tls ips and domains
This commit is contained in:
Johan T. Halseth
2019-05-22 08:59:19 +02:00
committed by GitHub
2 changed files with 21 additions and 21 deletions

14
lnd.go
View File

@@ -531,10 +531,12 @@ func genCertPair(certFile, keyFile string) error {
}
}
// Add extra IP to the slice.
ipAddr := net.ParseIP(cfg.TLSExtraIP)
if ipAddr != nil {
addIP(ipAddr)
// Add extra IPs to the slice.
for _, ip := range cfg.TLSExtraIPs {
ipAddr := net.ParseIP(ip)
if ipAddr != nil {
addIP(ipAddr)
}
}
// Collect the host's names into a slice.
@@ -546,9 +548,7 @@ func genCertPair(certFile, keyFile string) error {
if host != "localhost" {
dnsNames = append(dnsNames, "localhost")
}
if cfg.TLSExtraDomain != "" {
dnsNames = append(dnsNames, cfg.TLSExtraDomain)
}
dnsNames = append(dnsNames, cfg.TLSExtraDomains...)
// Also add fake hostnames for unix sockets, otherwise hostname
// verification will fail in the client.