Skip to content

HTTPS and TLS listeners on the same port #9516

Closed

Description

@alexarefev

Description:
The following Gateway:

apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
  name: default-external-gateway
  namespace: gateway-system
spec:
  gatewayClassName: external
  listeners:
  - allowedRoutes:
      namespaces:
        from: All
    name: http
    port: 80
    protocol: HTTP
  - allowedRoutes:
      namespaces:
        from: All
    name: https
    port: 443
    protocol: HTTPS
    tls:
      certificateRefs:
      - group: ""
        kind: Secret
        name: external-certificate
      mode: Terminate
  - allowedRoutes:
      namespaces:
        from: All
    hostname: tls-test.domain.local
    name: tls-1
    port: 443
    protocol: TLS
    tls:
      mode: Passthrough

causes the error messages in envoy pod:

[2026-07-17 07:33:17.467][1][warning][config] [source/extensions/config_subscription/grpc/grpc_subscription_impl.cc:138] gRPC config for type.googleapis.com/envoy.config.listener.v3.Listener rejected: Error adding/updating listener(s) gateway-system/default-external-gateway/https: error adding listener '0.0.0.0:10443': filter chain 'EmptyCluster' has the same matching rules defined as 'gateway-system/default-external-gateway/https'. duplicate matcher is: {}

The environment:
EnvoyGateway v1.8.2
Envoy v1.38.3
K8S v1.35.0

[Relevant Links:]
IT looks similar to issue

Activity

  1. added
    kind/bug
    on Jul 19, 2026
  2. arkodg commented on Jul 19, 2026

    @arkodg
    Contributor

    we probably need to undo the shared TCP route change in

    sharedEmptyTCPRoute = &ir.TCPRoute{
    and add an SNI to each route to make it unique to avoid getting NACKs

  3. Aditya7880900936 commented on Jul 23, 2026

    @Aditya7880900936
    Contributor

    hi @arkodg , I'd like to work on this issue if it's available.

    From the discussion, it looks like the duplicate filter chain is caused by the shared EmptyCluster TCP route for passthrough TLS listeners, which conflicts with the HTTPS listener on the same port.

    I'll investigate the translator logic around the shared TCP route and the suggestion to generate unique SNI matches for passthrough listeners to avoid duplicate filter chain matchers. If the proposed direction still makes sense, I'll work on a fix and open a PR.

    Please let me know if anyone is already working on this.

  4. Aditya7880900936 commented on Jul 24, 2026

    @Aditya7880900936
    Contributor

    Hi @arkodg ! I investigated the regression and found that the sharedEmptyTCPRoute optimization is causing the duplicate filter chain behavior. I also tried simply removing the shared route, but that breaks the existing tcp-multiple-tls-passthrough-no-routes regression test by creating multiple EmptyCluster filter chains.

    From your suggestion ("undo the shared TCP route change and add an SNI to each route to make it unique"), I'm unsure where the SNI should come from for synthetic empty routes. In the current tree, ir.TCPListener doesn't appear to carry hostname/SNI information, so processTCPListenerXdsTranslation() doesn't have anything to populate TLSInspectorConfig.SNIs with.

    Am I looking at the right approach, or is there another change (for example, propagating listener hostnames into the TCP IR) that I should make first?

  5. arkodg commented on Jul 26, 2026

    @arkodg
    Contributor

    there's an existing PR working on this already #9342 (comment)

  6. modified the milestones: v1.9.0 Release, Backlog on Aug 23, 2026
  7. removed this from the Backlog milestone on Sep 11, 2026
  8. 4 remaining items

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bug

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions