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

This commit is contained in:
Frank Schroeder 2017-05-25 00:06:38 +02:00
parent b6c69ebf5d
commit 26200929c1
No known key found for this signature in database
GPG Key ID: 4D65C6EAEC87DECD

View File

@ -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