TLS Options
The TLS options allow you to configure some parameters of the TLS connection in Traefik Hub API Gateway.
Register the TLSOption kind in the Kubernetes cluster before creating TLSOption objects or referencing TLS options in the IngressRoute / IngressRouteTCP objects.
Configuration Example
- TLSOption
- CA Certificate
apiVersion: traefik.io/v1alpha1
kind: TLSOption
metadata:
# Override the default TLS Option
name: default
namespace: traefik
spec:
minVersion: VersionTLS13
curvePreferences:
- CurveP521
- CurveP384
clientAuth:
# the CA certificate is extracted from key `tls.ca` or `ca.crt` of the given secrets.
secretNames:
- secretCA
clientAuthType: RequireAndVerifyClientCert
Domain: whoami.localhost
apiVersion: v1
kind: Secret
metadata:
name: secretCA
namespace: traefik
type: kubernetes.io/tls
data:
tls.ca: |
LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUZrekNDQTN1Z0F3SUJBZ0lVVk5SNkExZkQ3a1RDOUV5WGlPQXIxbHVwZFhvd0RRWUpLb1pJaHZjTkFRRUwKQlFBd1dURUxNQWtHQTFVRUJoTUNSbEl4RXpBUkJnTlZCQWdNQ2xOdmJXVXRVM1JoZEdVeERUQUxCZ05WQkFjTQpCRXg1YjI0eEZUQVRCZ05WQkFvTURGUnlZV1ZtYVdzZ1RHRmljekVQTUEwR0ExVUVBd3dHVjJodllXMXBNQjRYCkRUSTBNRGN4T0RFME1qazBPVm9YRFRJNU1EY3hPREUwTWprME9Wb3dXVEVMTUFrR0ExVUVCaE1DUmxJeEV6QVIKQmdOVkJBZ01DbE52YldVdFUzUmhkR1V4RFRBTEJnTlZCQWNNQkV4NWIyNHhGVEFUQmdOVkJBb01ERlJ5WVdWbQphV3NnVEdGaWN6RVBNQTBHQTFVRUF3d0dWMmh2WVcxcE1JSUNJakFOQmdrcWhraUc5dzBCQVFFRkFBT0NBZzhBCk1JSUNDZ0tDQWdFQW1XUDJORVlpN3VwbGgrZW42ZkM0N2pwVHVpbWJvM1ZTVkJ3VmgwK1RubXY3OEU2RE0zN00KS2thODI2OWc5elhLdjhna20xS0Jx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CtLL0tjeFUxWXNDZnRYK3FhdzdycWNyY3ZmNnhyaVh5NnNQSQo2NWVoSjdMTWExZDVOWURpUzZFV2JhaSs5dUREQUdqOEdSMG0xeEk1OWlmTHl2MnkzQUo2TTlMek1rNkpRVE9uCmxReGZGSFZoQTAvdk9aV3A5SWRTenBESW95TU5pdGNHVHlEeXllc1VOanMwYjZ0ek5kNU1SNlBLRUg5OE5uSC8KcVJkZnJMUUx5UUE0clJZd1MybHhvVHEzMXVMZUE1aXNtZWJCaGZpTVhLVjBWTmthNEhOQk81cWZVZURKcHlZbAo1Tmh1bkVBVnlZL2kwTGpZRDNYZ3VlV2ZNa3NMMjduTjNxUU9DaVBEZzFkQW5QRUhqWnVrZmhqSE9CZzdwTjJxCkFXRHVBeXlRMk5reTNrN0t1QXRqNWxyVGZTV2NJNndCQ2dNd2lYdHowNm1jdnQ2ZEhiM0pnd2J3U0tqRFdacmsKOGpzRzhNT0dUVlZQSVZmcG9hQlI0Q0UxZXRBSEdwbWxjQmxkUGQveWZWeG5rYVh3eDlTQmIzdEF4SUloYzNicwp4eDBLNE0ybmU5YmszQWRxd3lhcHYyZUJJeWNGRTYxaFhTS3VyZGo5VGw1UFpPYzluS3h2UW9sdmxrZGlxMmdjClZBVk5LUHdmSGxqZmFTNkV1aUxUNnltK2N5MmNsRFh2M3pUeFFTNWhKdjlKc2sySWt3L3lqMFVCdDk4Mzc4dHIKUWkvZXJCdk9Sd0JJOEdoRVdnSDI1amFrSStzaDZheWVlNnNEemR1TFN3enBhbU9rNWwxUzFnSGRQVGdXQ1dUdwpVYS9sR2ZleVZJOS96SWtZdk9uTFFtU3F2SUx4bytOZC94UkxGb1IwU3h2RWkxdVBsQXZZCi0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K
Configuration Options
Field | Description | Default | Required |
---|---|---|---|
name | Name of the TLSOption resource. Using default redefines the default TLSOption. | True | |
minVersion | Minimum TLS version that is acceptable. | "VersionTLS12" | False |
maxVersion | Maximum TLS version that is acceptable. We do not recommend setting this option to disable TLS 1.3. | False | |
cipherSuites | List of supported cipher suites for TLS versions up to TLS 1.2. [Cipher suites defined for TLS 1.2 and below cannot be used in TLS 1.3, and vice versa.](https://tools.ietf.org/html/rfc8446 With TLS 1.3, the cipher suites are not configurable (all supported cipher suites are safe in this case). | False | |
curvePreferences | List of the elliptic curves references that will be used in an ECDHE handshake, in preference order. Use curves names from crypto or the RFC.See CurveID for more information. | False | |
clientAuth.secretNames | Client Authentication (mTLS) option. List of names of the referenced Kubernetes Secrets (in TLSOption namespace). The secret must contain a certificate under either a tls.ca or a ca.crt key. | False | |
clientAuth.clientAuthType | Client Authentication (mTLS) option. Client authentication type to apply. Available values here. | False | |
sniStrict | Allow rejecting connections from clients connections that do not specify a server_name extension. The default certificate is never served is the option is enabled. | false | False |
alpnProtocols | List of supported application level protocols for the TLS handshake, in order of preference. If the client supports ALPN, the selected protocol will be one from this list, and the connection will fail if there is no mutually supported protocol. | "h2, http/1.1, acme-tls/1" | False |
clientAuth.clientAuthType
The clientAuth.clientAuthType
option governs the behaviour as follows:
NoClientCert
: disregards any client certificate.RequestClientCert
: asks for a certificate but proceeds anyway if none is provided.RequireAnyClientCert
: requires a certificate but does not verify if it is signed by a CA listed inclientAuth.caFiles
or inclientAuth.secretNames
.VerifyClientCertIfGiven
: if a certificate is provided, verifies if it is signed by a CA listed inclientAuth.caFiles
or inclientAuth.secretNames
. Otherwise proceeds without any certificate.RequireAndVerifyClientCert
: requires a certificate, which must be signed by a CA listed inclientAuth.caFiles
or inclientAuth.secretNames
.
Default TLS Option
The default
option is special.
When no TLS options are specified in an Ingress or IngressRoute, the default
option is used.
The default behavior is summed up in the table below:
Configuration | Behavior |
---|---|
No default TLS Option | Default internal set of TLS Options by default |
One default TLS Option | Custom TLS Options applied by default |
Many default TLS Option | Error log + Default internal set of TLS Options by default |