fix(proxy): use TLS to backends for terminate-and-reencrypt routes
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user