summaryrefslogtreecommitdiff
path: root/src/conf_mode
diff options
context:
space:
mode:
authorViacheslav Hletenko <v.gletenko@vyos.io>2024-02-06 14:39:15 +0000
committerMergify <37929162+mergify[bot]@users.noreply.github.com>2024-02-06 16:49:09 +0000
commitea8f374a37ecbed6e256ddeab2c837d7cc6ad611 (patch)
tree28e5e9298c04e10e8c3035124abcbe48b3f01f59 /src/conf_mode
parentb10d1c0bd60d3497417e124c6d5e0f5291a56853 (diff)
downloadvyos-1x-ea8f374a37ecbed6e256ddeab2c837d7cc6ad611.tar.gz
vyos-1x-ea8f374a37ecbed6e256ddeab2c837d7cc6ad611.zip
T5921: Fix OpenConnect verify for local users
Fix verify error for the VPN OpenConnect configuration with local authentication and without any user File "/usr/libexec/vyos/conf_mode/vpn_openconnect.py", line 94, in verify if not ocserv["authentication"]["local_users"]: KeyError: 'local_users' (cherry picked from commit 71644dfed63f6248525db3c3bc9493c059707a2a)
Diffstat (limited to 'src/conf_mode')
-rwxr-xr-xsrc/conf_mode/vpn_openconnect.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/conf_mode/vpn_openconnect.py b/src/conf_mode/vpn_openconnect.py
index 421ac6997..08e4fc6db 100755
--- a/src/conf_mode/vpn_openconnect.py
+++ b/src/conf_mode/vpn_openconnect.py
@@ -91,7 +91,7 @@ def verify(ocserv):
if not ocserv["authentication"]['radius']['server']:
raise ConfigError('Openconnect authentication mode radius requires at least one RADIUS server')
if "local" in ocserv["authentication"]["mode"]:
- if not ocserv["authentication"]["local_users"]:
+ if not ocserv.get("authentication", {}).get("local_users"):
raise ConfigError('openconnect mode local required at least one user')
if not ocserv["authentication"]["local_users"]["username"]:
raise ConfigError('openconnect mode local required at least one user')