Skip to content

Commit a3763a2

Browse files
dmbaturinmergify[bot]
authored andcommitted
openvpn: T6374: ensure that TLS role is configured for site-to-site with TLS
(cherry picked from commit 380e998)
1 parent 9d0a453 commit a3763a2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/conf_mode/interfaces_openvpn.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,11 @@ def verify(openvpn):
260260
# OpenVPN site-to-site - VERIFY
261261
#
262262
elif openvpn['mode'] == 'site-to-site':
263+
# XXX: site-to-site is the only mode that still can work without TLS,
264+
# so we need to make sure that if TLS is used, then TLS role is also specified
265+
if 'shared_secret_key' not in openvpn['tls'] and 'role' not in openvpn['tls']:
266+
raise ConfigError('"tls role" is required for site-to-site OpenVPN with TLS')
267+
263268
if 'local_address' not in openvpn and 'is_bridge_member' not in openvpn:
264269
raise ConfigError('Must specify "local-address" or add interface to bridge')
265270

0 commit comments

Comments
 (0)