Skip to main content
Agentgateway supports HTTPS listeners with full TLS termination, configurable cipher suites, TLS version pinning, backend TLS for upstream connections, and mutual TLS (mTLS) for client certificate authentication.

Basic TLS termination

To expose a listener over HTTPS, set the listener protocol to HTTPS and supply a tls block with the paths to your certificate and private key.
This is the exact configuration from examples/tls/config.yaml. Self-signed certificates require the -k flag when testing with curl.
Verify that TLS is working:
The request fails because no valid MCP request was sent, but the TLS handshake succeeded.
The MCP Inspector does not support unverified (self-signed) TLS certificates. Use curl -k or a CA-signed certificate when testing.

TLS fields reference

Cipher suites

You can restrict which cipher suites the listener negotiates. The order you specify is preserved — agentgateway will prefer suites listed first.

Supported cipher suites

TLS version control

Agentgateway supports TLS 1.2 and TLS 1.3 only. Use minTLSVersion and maxTLSVersion to pin the acceptable range.
Attempts to configure versions below TLS 1.2 are not supported.

Backend TLS

When agentgateway proxies traffic to an upstream service that requires TLS, configure backendTLS on the route policy. Agentgateway will use the system trusted CA certificates by default, and automatically derive the SNI from the destination hostname.

Custom CA certificate

To verify the upstream with a custom CA, reference a ConfigMap containing the CA certificate:

Custom SNI

Override the SNI sent during the TLS handshake:

Skip verification (insecure)

Skipping TLS verification is insecure. Only use this in development environments.
The Hostname mode verifies the CA certificate but ignores hostname/SAN mismatches.

Mutual TLS (mTLS)

mTLS requires clients to present a certificate signed by a trusted CA. Set the tls.root field to the CA certificate path on the listener.

Backend mTLS

To use a client certificate when connecting to a backend (outbound mTLS), reference a Kubernetes Secret containing the client certificate:
The Secret must be of type kubernetes.io/tls with tls.crt and tls.key data fields. An optional ca.crt field, if present, will be used to verify the server certificate.

Complete example

1

Generate a self-signed certificate

2

Write the agentgateway config

3

Start agentgateway

4

Test the connection