Skip to content

TLS / mTLS

Nantian Gateway supports TLS for three communication channels: the admin HTTP API, the gRPC xDS stream between control plane and data plane, and the xDS transport from the data plane side. Each channel is configured independently.

The control plane exposes two TLS-capable servers: the admin HTTP server and the gRPC xDS server.

Secures the admin HTTP API with server-side TLS:

ParameterTypeDefaultDescription
adminTLS.enabledboolfalseEnable TLS on the admin HTTP server
adminTLS.cert_pathstring""Path to the server certificate file (PEM)
adminTLS.key_pathstring""Path to the server private key file (PEM)

When enabled, the admin server serves HTTPS instead of HTTP. The certificate and key must be valid PEM-encoded files readable by the control plane process. In Kubernetes, mount these from a Secret volume.

Secures the gRPC xDS stream with optional mutual TLS:

ParameterTypeDefaultDescription
grpcTLS.enabledboolfalseEnable TLS on the gRPC server
grpcTLS.cert_pathstring""Path to the server certificate file (PEM)
grpcTLS.key_pathstring""Path to the server private key file (PEM)
grpcTLS.clientCAPathstring""Path to the CA certificate for verifying client certificates
grpcTLS.requireClientCertboolfalseRequire and verify client certificates (mTLS)

Setting requireClientCert to true enables mutual TLS. Every data plane that connects must present a certificate signed by the CA specified in clientCAPath. Without mTLS, any client that can reach the gRPC port can receive configuration snapshots.

The data plane has two TLS-related configuration sections: the proxy runtime (client-facing TLS) and the xDS transport (control plane connection).

These settings control TLS behavior for traffic passing through the data plane:

ParameterTypeDefaultDescription
runtime.tls_min_versionstring"1.2"Minimum TLS version accepted ("1.2" or "1.3")
runtime.tls_max_versionstring"1.3"Maximum TLS version accepted ("1.2" or "1.3")

Configures how the data plane connects to the control plane’s gRPC server:

ParameterTypeDefaultDescription
xds_tls.enabledboolfalseEnable TLS for the xDS connection
xds_tls.domain_namestring""Expected server name for certificate validation
xds_tls.ca_pathstring""Path to the CA certificate for verifying the server
xds_tls.cert_pathstring""Path to the client certificate (for mTLS)
xds_tls.key_pathstring""Path to the client private key (for mTLS)

When both cert_path and key_path are set, the data plane presents a client certificate to the control plane, satisfying the mTLS requirement when requireClientCert is enabled on the gRPC server.

The following configuration enables mTLS on the gRPC stream and TLS on the admin API:

# Control plane
grpcTLS:
enabled: true
cert_path: /etc/certs/grpc/tls.crt
key_path: /etc/certs/grpc/tls.key
clientCAPath: /etc/certs/grpc/ca.crt
requireClientCert: true
adminTLS:
enabled: true
cert_path: /etc/certs/admin/tls.crt
key_path: /etc/certs/admin/tls.key
# Data plane
xds_tls:
enabled: true
domain_name: nantian-gw-controlplane-grpc.nantian-gw.svc
ca_path: /etc/certs/xds/ca.crt
cert_path: /etc/certs/xds/tls.crt
key_path: /etc/certs/xds/tls.key

Certificates can be provisioned through several approaches:

  • cert-manager — automatically issues and rotates certificates using the Kubernetes cert-manager operator
  • Manual provisioning — generate certificates with tools like openssl or cfssl and mount them as Kubernetes Secrets
  • Vault — integrate with HashiCorp Vault for centralized certificate management

For production deployments, cert-manager is recommended. It handles certificate issuance, renewal, and rotation without manual intervention.