Tcp Tls Mtls

The proxy requires TCP clients to present a valid TLS certificate signed by the trusted CA

Category: Setup-dependent integration
Task: The proxy requires TCP clients to present a valid TLS certificate signed by the trusted CA

Prerequisites: The external service, credentials, or certificates referenced by this configuration.

This configuration comes from the selected release. The example has not been run here; external services are not bundled.

Download the source file.

# TCP mTLS (Client Certificate Required)
#
# The proxy requires TCP clients to present a valid TLS
# certificate signed by the trusted CA. Connections without
# a client cert are rejected at the TLS layer. Plain TCP is
# forwarded to the upstream backend.
#
#   Client -> mTLS -> Praxis :5432 -> TCP -> PostgreSQL :15432
#
# Usage:
#   cargo run -p praxis-proxy -- -c examples/configs/protocols/tcp-tls-mtls.yaml
#   psql "sslmode=verify-full sslcert=client.pem \
#     sslkey=client-key.pem sslrootcert=ca.pem \
#     host=localhost port=5432 dbname=mydb"

insecure_options:
  allow_private_upstreams: true

listeners:
  - name: secure-db
    address: "127.0.0.1:5432"
    protocol: tcp
    upstream: "127.0.0.1:15432"
    tls:
      certificates:
        - cert_path: /etc/ssl/certs/server.pem
          key_path: /etc/ssl/private/server-key.pem
      client_ca:
        ca_path: /etc/ssl/certs/client-ca.pem
      client_cert_mode: require