agent: start HTTPS only if there is a cert and key

pull/3037/head
Frank Schroeder 8 years ago
parent b6c69ebf5d
commit 26200929c1
No known key found for this signature in database
GPG Key ID: 4D65C6EAEC87DECD

@ -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…
Cancel
Save