diff --git a/pkg/provider/kubernetes/crd/kubernetes.go b/pkg/provider/kubernetes/crd/kubernetes.go index 36720e899..c4c79f2a8 100644 --- a/pkg/provider/kubernetes/crd/kubernetes.go +++ b/pkg/provider/kubernetes/crd/kubernetes.go @@ -422,26 +422,6 @@ func (p *Provider) loadConfigurationFromCRD(ctx context.Context, client Client) } } - if serversTransport.Spec.MinVersion != "" { - if _, exists := tls.MinVersion[serversTransport.Spec.MinVersion]; exists { - sTransport.MinVersion = serversTransport.Spec.MinVersion - } else { - // Min TLS version does not exist - logger.Error().Msgf("invalid TLS minimal version: %s", serversTransport.Spec.MinVersion) - continue - } - } - - if serversTransport.Spec.MaxVersion != "" { - if _, exists := tls.MaxVersion[serversTransport.Spec.MaxVersion]; exists { - sTransport.MaxVersion = serversTransport.Spec.MaxVersion - } else { - // Min TLS version does not exist - logger.Error().Msgf("invalid TLS maximal version: %s", serversTransport.Spec.MaxVersion) - continue - } - } - forwardingTimeout := &dynamic.ForwardingTimeouts{} forwardingTimeout.SetDefaults() @@ -488,9 +468,9 @@ func (p *Provider) loadConfigurationFromCRD(ctx context.Context, client Client) InsecureSkipVerify: serversTransport.Spec.InsecureSkipVerify, RootCAs: rootCAs, Certificates: certs, - CipherSuites: sTransport.CipherSuites, - MinVersion: sTransport.MinVersion, - MaxVersion: sTransport.MaxVersion, + CipherSuites: serversTransport.Spec.CipherSuites, + MinVersion: serversTransport.Spec.MinVersion, + MaxVersion: serversTransport.Spec.MaxVersion, DisableHTTP2: serversTransport.Spec.DisableHTTP2, MaxIdleConnsPerHost: serversTransport.Spec.MaxIdleConnsPerHost, ForwardingTimeouts: forwardingTimeout, diff --git a/pkg/server/service/transport.go b/pkg/server/service/transport.go index f7a526fe1..7959f5059 100644 --- a/pkg/server/service/transport.go +++ b/pkg/server/service/transport.go @@ -187,26 +187,16 @@ func (t *TransportManager) createTLSConfig(cfg *dynamic.ServersTransport) (*tls. } } - // Set the min TLS version if set in the config + // Set the minimum TLS version if set in the config var minVer uint16 - if cfg.MinVersion != "" { - if minConst, exists := traefiktls.MinVersion[cfg.MinVersion]; exists { - minVer = minConst - } else { - // Min TLS version does not exist - return nil, fmt.Errorf("invalid TLS minimal version: %v", minVer) - } + if minConst, exists := traefiktls.MinVersion[cfg.MinVersion]; exists { + minVer = minConst } - // Set the min TLS version if set in the config + // Set the minimum TLS version if set in the config var maxVer uint16 - if cfg.MinVersion != "" { - if maxConst, exists := traefiktls.MaxVersion[cfg.MaxVersion]; exists { - maxVer = maxConst - } else { - // Max TLS version does not exist - return nil, fmt.Errorf("invalid TLS maximal version: %v", maxVer) - } + if maxConst, exists := traefiktls.MaxVersion[cfg.MaxVersion]; exists { + maxVer = maxConst } config = &tls.Config{