config: allow adding multiple tls ips and domains

This commit is contained in:
Matt Drollette
2019-02-25 22:21:46 -06:00
parent 3895a4f276
commit 261558aad6
2 changed files with 21 additions and 21 deletions

14
lnd.go
View File

@@ -486,10 +486,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.
@@ -501,9 +503,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.