summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-08-13 18:34:42 +0200
committerGitHub <noreply@github.com>2021-08-13 18:34:42 +0200
commitaa024a5c0afd11bb8e517b3a6231eb10f448a85f (patch)
treef0fbfa650d76fda56c166d3c3bf73c53dbc4c42c
parente5c61fc80119556bb1b61a80868d4a3470e07319 (diff)
parent655876f4c22c0f4ea839a81f4af09d6016e19197 (diff)
downloadvyos-1x-aa024a5c0afd11bb8e517b3a6231eb10f448a85f.tar.gz
vyos-1x-aa024a5c0afd11bb8e517b3a6231eb10f448a85f.zip
Merge pull request #968 from sever-sever/T3738
openvpn: T3738: Disable authentication option for server mode
-rwxr-xr-xsrc/conf_mode/interfaces-openvpn.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/conf_mode/interfaces-openvpn.py b/src/conf_mode/interfaces-openvpn.py
index 74e29ed82..6be4e918b 100755
--- a/src/conf_mode/interfaces-openvpn.py
+++ b/src/conf_mode/interfaces-openvpn.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
#
-# Copyright (C) 2019-2020 VyOS maintainers and contributors
+# Copyright (C) 2019-2021 VyOS maintainers and contributors
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 or later as
@@ -273,6 +273,9 @@ def verify(openvpn):
if openvpn['protocol'] == 'tcp-active':
raise ConfigError('Protocol "tcp-active" is not valid in server mode')
+ if dict_search('authentication.username', openvpn) or dict_search('authentication.password', openvpn):
+ raise ConfigError('Cannot specify "authentication" in server mode')
+
if 'remote_port' in openvpn:
raise ConfigError('Cannot specify "remote-port" in server mode')