mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-27 14:11:04 +02:00
lnd+config: allow Let's Encrypt listen IP to be set
To make it possible to request a Let's Encrypt certificate by using a different IP address where the port 80 might still be free, we add the IP part to its configuration as well instead of just the port. This makes it possible to use an IPv6 address for the ACME request if all available IPv4 addresses already have their port 80 occupied.
This commit is contained in:
5
lnd.go
5
lnd.go
@@ -863,9 +863,8 @@ func getTLSConfig(cfg *Config) (*tls.Config, *credentials.TransportCredentials,
|
||||
HostPolicy: autocert.HostWhitelist(cfg.LetsEncryptDomain),
|
||||
}
|
||||
|
||||
addr := fmt.Sprintf(":%v", cfg.LetsEncryptPort)
|
||||
srv := &http.Server{
|
||||
Addr: addr,
|
||||
Addr: cfg.LetsEncryptListen,
|
||||
Handler: manager.HTTPHandler(nil),
|
||||
}
|
||||
shutdownCompleted := make(chan struct{})
|
||||
@@ -883,7 +882,7 @@ func getTLSConfig(cfg *Config) (*tls.Config, *credentials.TransportCredentials,
|
||||
|
||||
go func() {
|
||||
ltndLog.Infof("Autocert challenge listener started "+
|
||||
"at %v", addr)
|
||||
"at %v", cfg.LetsEncryptListen)
|
||||
|
||||
err := srv.ListenAndServe()
|
||||
if err != http.ErrServerClosed {
|
||||
|
Reference in New Issue
Block a user