Do not create self-signed certs if port is zero

This commit is contained in:
Dr. Stefan Schimanski 2016-12-08 13:06:16 +01:00
parent f8dd91fb28
commit f0abf15ea7

View File

@ -175,7 +175,7 @@ func (s *ServingOptions) AddDeprecatedFlags(fs *pflag.FlagSet) {
func (s *SecureServingOptions) MaybeDefaultWithSelfSignedCerts(publicAddress string, alternateIPs ...net.IP) error {
keyCert := &s.ServerCert.CertKey
if s == nil || len(keyCert.CertFile) != 0 || len(keyCert.KeyFile) != 0 {
if s == nil || s.ServingOptions.BindPort == 0 || len(keyCert.CertFile) != 0 || len(keyCert.KeyFile) != 0 {
return nil
}