TIS0303 - Duplicate Certificates in Multiple Gateways
Duplicate certificates in multiple Gateway
resources may cause 404 errors if clients reuse HTTP2 connections.
To prevent routing issues such as 404 errors when clients reuse HTTP2 connections, avoid using the same certificates in multiple Gateway
resources for the same host. Consolidate configurations or use unique certificates.
Examples
-
Two Gateways Using the Same Certificate
First
Gateway
:apiVersion: networking.istio.io/v1beta1
kind: Gateway
metadata:
name: gateway-1
namespace: example-namespace
spec:
selector:
istio: ingressgateway
servers:
- port:
number: 443
name: https
protocol: HTTPS
hosts:
- "example.com"
tls:
mode: SIMPLE
credentialName: example-certSecond
Gateway
:apiVersion: networking.istio.io/v1beta1
kind: Gateway
metadata:
name: gateway-2
namespace: example-namespace
spec:
selector:
istio: ingressgateway
servers:
- port:
number: 443
name: https
protocol: HTTPS
hosts:
- "example.com"
tls:
mode: SIMPLE
credentialName: example-certExplanation: Both
Gateway
resources are using the same certificate (credentialName: example-cert
) for the same host. This can cause issues, such as 404 errors, when clients reuse HTTP2 connections, since the certificates being used by multipleGateways
can create routing ambiguities.
Recommendation
Consolidate the certificates by using a single Gateway
for the host, or ensure that different certificates are used to prevent conflicts.
-
Use a Single Gateway for the Host
Consolidate the configurations into a single
Gateway
to avoid certificate duplication.apiVersion: networking.istio.io/v1beta1
kind: Gateway
metadata:
name: consolidated-gateway
namespace: example-namespace
spec:
selector:
istio: ingressgateway
servers:
- port:
number: 443
name: https
protocol: HTTPS
hosts:
- "example.com"
tls:
mode: SIMPLE
credentialName: example-cert -
Use Different Certificates for Each Gateway
If multiple
Gateways
are required, use different certificates for each gateway to prevent routing issues.apiVersion: networking.istio.io/v1beta1
kind: Gateway
metadata:
name: gateway-1
namespace: example-namespace
spec:
selector:
istio: ingressgateway
servers:
- port:
number: 443
name: https
protocol: HTTPS
hosts:
- "example.com"
tls:
mode: SIMPLE
credentialName: example-cert-1apiVersion: networking.istio.io/v1beta1
kind: Gateway
metadata:
name: gateway-2
namespace: example-namespace
spec:
selector:
istio: ingressgateway
servers:
- port:
number: 443
name: https
protocol: HTTPS
hosts:
- "example.com"
tls:
mode: SIMPLE
credentialName: example-cert-2