# TLS Cipher Suite Restriction
#
# Restrict accepted cipher suites per listener. Only the
# listed suites will be offered during the TLS handshake.
# Clients that do not support any of the configured suites
# will be rejected.
#
# Available cipher suites:
#
#   TLS 1.3:
#     tls13_aes_128_gcm_sha256
#     tls13_aes_256_gcm_sha384
#     tls13_chacha20_poly1305_sha256
#
#   TLS 1.2:
#     tls12_ecdhe_ecdsa_with_aes_128_gcm_sha256
#     tls12_ecdhe_ecdsa_with_aes_256_gcm_sha384
#     tls12_ecdhe_ecdsa_with_chacha20_poly1305_sha256
#     tls12_ecdhe_rsa_with_aes_128_gcm_sha256
#     tls12_ecdhe_rsa_with_aes_256_gcm_sha384
#     tls12_ecdhe_rsa_with_chacha20_poly1305_sha256
#
# When combined with `min_version: tls13`, only TLS 1.3
# cipher suites are allowed. TLS 1.2 suites in that
# combination are rejected at config validation.
#
# Usage:
#   mkcert -install && mkcert localhost 127.0.0.1
#   cargo run -p praxis-proxy -- -c examples/configs/protocols/tls-cipher-suites.yaml
#   curl https://localhost:8443/

listeners:
  - name: restricted
    address: "127.0.0.1:8443"
    filter_chains:
      - main
    tls:
      certificates:
        - cert_path: ./localhost+1.pem
          key_path: ./localhost+1-key.pem
      cipher_suites:
        - tls13_aes_256_gcm_sha384
        - tls13_aes_128_gcm_sha256

filter_chains:
  - name: main
    filters:
      - filter: router
        routes:
          - path_prefix: "/"
            cluster: backend

      - filter: load_balancer
        clusters:
          - name: backend
            endpoints:
              - "127.0.0.1:3000"

insecure_options:
  allow_private_endpoints: true # example proxies to local backends
