diff options
author | Daniil Baturin <daniil@vyos.io> | 2024-05-27 09:36:44 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-27 09:36:44 +0200 |
commit | 5cd0e322816320b05f3a1f854aad0ada8eac349f (patch) | |
tree | 483315b73ce21fbfe70d60bb7376de75b5a8894f /src/conf_mode/load-balancing_reverse-proxy.py | |
parent | b35188de4f872c76c0b8320b8f9ccefb63a081ae (diff) | |
parent | d575ce3cc2163eaa851e1909ad74e96a7f00c208 (diff) | |
download | vyos-1x-5cd0e322816320b05f3a1f854aad0ada8eac349f.tar.gz vyos-1x-5cd0e322816320b05f3a1f854aad0ada8eac349f.zip |
Merge pull request #3526 from vyos/mergify/bp/sagitta/pr-3523
reverse-proxy: T6402: Fix invalid checks in validation script (backport #3523)
Diffstat (limited to 'src/conf_mode/load-balancing_reverse-proxy.py')
-rwxr-xr-x | src/conf_mode/load-balancing_reverse-proxy.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/conf_mode/load-balancing_reverse-proxy.py b/src/conf_mode/load-balancing_reverse-proxy.py index a4efb1cd8..b6db110ae 100755 --- a/src/conf_mode/load-balancing_reverse-proxy.py +++ b/src/conf_mode/load-balancing_reverse-proxy.py @@ -88,22 +88,22 @@ def verify(lb): if {'send_proxy', 'send_proxy_v2'} <= set(bk_server_conf): raise ConfigError(f'Cannot use both "send-proxy" and "send-proxy-v2" for server "{bk_server}"') + if 'ssl' in back_config: + if {'no_verify', 'ca_certificate'} <= set(back_config['ssl']): + raise ConfigError(f'backend {back} cannot have both ssl options no-verify and ca-certificate set!') + # Check if http-response-headers are configured in any frontend/backend where mode != http for group in ['service', 'backend']: for config_name, config in lb[group].items(): if 'http_response_headers' in config and ('mode' not in config or config['mode'] != 'http'): raise ConfigError(f'{group} {config_name} must be set to http mode to use http_response_headers!') - if 'ssl' in back_config: - if {'no_verify', 'ca_certificate'} <= set(back_config['ssl']): - raise ConfigError(f'backend {back} cannot have both ssl options no-verify and ca-certificate set!') - for front, front_config in lb['service'].items(): for cert in dict_search('ssl.certificate', front_config) or []: verify_pki_certificate(lb, cert) for back, back_config in lb['backend'].items(): - tmp = dict_search('ssl.ca_certificate', front_config) + tmp = dict_search('ssl.ca_certificate', back_config) if tmp: verify_pki_ca_certificate(lb, tmp) |