mirror of
https://github.com/traefik/traefik.git
synced 2025-08-07 15:17:09 +02:00
Revert "add min and max version to tranport in k8s provider and validate if empty"
This reverts commit 44535ee1dc
.
This commit is contained in:
parent
4982d0b43c
commit
02c00ef536
@ -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 := &dynamic.ForwardingTimeouts{}
|
||||||
forwardingTimeout.SetDefaults()
|
forwardingTimeout.SetDefaults()
|
||||||
|
|
||||||
@ -488,9 +468,9 @@ func (p *Provider) loadConfigurationFromCRD(ctx context.Context, client Client)
|
|||||||
InsecureSkipVerify: serversTransport.Spec.InsecureSkipVerify,
|
InsecureSkipVerify: serversTransport.Spec.InsecureSkipVerify,
|
||||||
RootCAs: rootCAs,
|
RootCAs: rootCAs,
|
||||||
Certificates: certs,
|
Certificates: certs,
|
||||||
CipherSuites: sTransport.CipherSuites,
|
CipherSuites: serversTransport.Spec.CipherSuites,
|
||||||
MinVersion: sTransport.MinVersion,
|
MinVersion: serversTransport.Spec.MinVersion,
|
||||||
MaxVersion: sTransport.MaxVersion,
|
MaxVersion: serversTransport.Spec.MaxVersion,
|
||||||
DisableHTTP2: serversTransport.Spec.DisableHTTP2,
|
DisableHTTP2: serversTransport.Spec.DisableHTTP2,
|
||||||
MaxIdleConnsPerHost: serversTransport.Spec.MaxIdleConnsPerHost,
|
MaxIdleConnsPerHost: serversTransport.Spec.MaxIdleConnsPerHost,
|
||||||
ForwardingTimeouts: forwardingTimeout,
|
ForwardingTimeouts: forwardingTimeout,
|
||||||
|
@ -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
|
var minVer uint16
|
||||||
if cfg.MinVersion != "" {
|
|
||||||
if minConst, exists := traefiktls.MinVersion[cfg.MinVersion]; exists {
|
if minConst, exists := traefiktls.MinVersion[cfg.MinVersion]; exists {
|
||||||
minVer = minConst
|
minVer = minConst
|
||||||
} else {
|
|
||||||
// Min TLS version does not exist
|
|
||||||
return nil, fmt.Errorf("invalid TLS minimal version: %v", minVer)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set the min TLS version if set in the config
|
// Set the minimum TLS version if set in the config
|
||||||
var maxVer uint16
|
var maxVer uint16
|
||||||
if cfg.MinVersion != "" {
|
|
||||||
if maxConst, exists := traefiktls.MaxVersion[cfg.MaxVersion]; exists {
|
if maxConst, exists := traefiktls.MaxVersion[cfg.MaxVersion]; exists {
|
||||||
maxVer = maxConst
|
maxVer = maxConst
|
||||||
} else {
|
|
||||||
// Max TLS version does not exist
|
|
||||||
return nil, fmt.Errorf("invalid TLS maximal version: %v", maxVer)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
config = &tls.Config{
|
config = &tls.Config{
|
||||||
|
Loading…
Reference in New Issue
Block a user