mirror of
https://github.com/status-im/consul.git
synced 2025-02-02 08:56:43 +00:00
agent: start HTTPS only if there is a cert and key
This commit is contained in:
parent
b6c69ebf5d
commit
26200929c1
@ -815,7 +815,7 @@ func (c *Config) HTTPAddrs() ([]ProtoAddr, error) {
|
|||||||
}
|
}
|
||||||
addrs = append(addrs, ProtoAddr{"http", a.Network(), a.String()})
|
addrs = append(addrs, ProtoAddr{"http", a.Network(), a.String()})
|
||||||
}
|
}
|
||||||
if c.Ports.HTTPS > 0 {
|
if c.Ports.HTTPS > 0 && c.CertFile != "" && c.KeyFile != "" {
|
||||||
a, err := c.ClientListener(c.Addresses.HTTPS, c.Ports.HTTPS)
|
a, err := c.ClientListener(c.Addresses.HTTPS, c.Ports.HTTPS)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
Loading…
x
Reference in New Issue
Block a user