Skip to content

BackendTLSPolicy hostname field ignored when validating certificates #3518

@vondrt4

Description

@vondrt4

Describe the bug
I'm testing a scenario where NGF should re-encrypt traffic to a backend. The backend has a different hostname than the listener at the Gateway. Traffic does not pass and I'm seeing validation errors is the gateway Pod logs showing that it's trying to validate using the backend certificate using the listener hostname.

To Reproduce
I'm attaching my demo setup's YAML.

Expected behavior
If I have this in my BackendTLSPolicy, I expect not only the Host header and SNI to be set to the hostname, but also the certificate validation to take it into account.
spec:
validation:
caCertificateRefs:
- kind: Secret
name: ca-root-secret
hostname: https-portal-2.app-ns2.svc.local

Your environment

  • Version of the NGINX Gateway Fabric: 2.0.0 with experimental API enabled
  • Version of Kubernetes: 1.32
  • Kubernetes platform: Azure AKS
  • Details on how you expose the NGINX Gateway Fabric Pod: Service of type LoadBalancer

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    ✅ Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions