mirror of https://github.com/status-im/consul.git
connect/proxy: don't start public listener if 0 port
This commit is contained in:
parent
42ee214c8a
commit
baa551355e
|
@ -60,11 +60,15 @@ func (p *Proxy) Serve() error {
|
||||||
p.logger.Printf("[DEBUG] leaf: %s roots: %s", leaf.URIs[0], bytes.Join(tcfg.RootCAs.Subjects(), []byte(",")))
|
p.logger.Printf("[DEBUG] leaf: %s roots: %s", leaf.URIs[0], bytes.Join(tcfg.RootCAs.Subjects(), []byte(",")))
|
||||||
}()
|
}()
|
||||||
|
|
||||||
newCfg.PublicListener.applyDefaults()
|
// Only start a listener if we have a port set. This allows
|
||||||
l := NewPublicListener(p.service, newCfg.PublicListener, p.logger)
|
// the configuration to disable our public listener.
|
||||||
err = p.startListener("public listener", l)
|
if newCfg.PublicListener.BindPort != 0 {
|
||||||
if err != nil {
|
newCfg.PublicListener.applyDefaults()
|
||||||
return err
|
l := NewPublicListener(p.service, newCfg.PublicListener, p.logger)
|
||||||
|
err = p.startListener("public listener", l)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue