Skip to content

h2: support TLS for backend (upstream) connections #1218

Description

@FlorentinDUBOIS

Summary

Backend H2 connections are always Connection<TcpStream> (cleartext) in Router.backends: HashMap<Token, Connection<TcpStream>> at lib/src/protocol/mux/mod.rs.

This means H2 backend proxying uses h2c (cleartext HTTP/2) to upstreams. For environments requiring end-to-end encryption (e.g., mutual TLS to backends, zero-trust networking), backends should support TLS wrapping.

Current state

  • Frontend: supports both TcpStream (HTTP) and FrontRustls (HTTPS)
  • Backend: only TcpStream — no TLS

Possible approach

  • Introduce a backend TLS wrapper (similar to FrontRustls but for client-initiated connections)
  • Add a per-cluster backend_tls config flag alongside the existing http2 flag
  • Backend Connection<TlsStream> variant for TLS-wrapped upstreams

Priority

Low — most deployments terminate TLS at the proxy and use plaintext to trusted backends.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementh2tlsall regarding certificates and handshakes

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions