fix: change tls -> https since the redirection is http-specific feature on app layer

This commit is contained in:
Jun Kurihara 2024-09-06 18:07:58 +09:00
commit 6f7119c933
No known key found for this signature in database
GPG key ID: D992B3E3DE1DED23
5 changed files with 27 additions and 6 deletions

View file

@ -59,6 +59,13 @@ pub fn build_settings(config: &ConfigToml) -> std::result::Result<(ProxyConfig,
"Some apps serves only plaintext HTTP"
);
}
// https redirection port must be configured only when both http_port and https_port are configured.
if proxy_config.https_redirection_port.is_some() {
ensure!(
proxy_config.https_port.is_some() && proxy_config.http_port.is_some(),
"https_redirection_port can be specified only when both http_port and https_port are specified"
);
}
// https redirection can be configured if both ports are active
if !(proxy_config.https_port.is_some() && proxy_config.http_port.is_some()) {
ensure!(