fix(proxy): use TLS to backends for terminate-and-reencrypt routes

This commit is contained in:
2026-02-16 13:29:45 +00:00
parent 9fac17bc39
commit 101675b5f8
5 changed files with 95 additions and 6 deletions

View File

@@ -344,7 +344,15 @@ impl HttpProxyService {
}
};
let upstream = self.upstream_selector.select(target, &peer_addr, port);
let mut upstream = self.upstream_selector.select(target, &peer_addr, port);
// If the route uses terminate-and-reencrypt, always re-encrypt to backend
if let Some(ref tls) = route_match.route.action.tls {
if tls.mode == rustproxy_config::TlsMode::TerminateAndReencrypt {
upstream.use_tls = true;
}
}
let upstream_key = format!("{}:{}", upstream.host, upstream.port);
self.upstream_selector.connection_started(&upstream_key);