From d7a2c7c1930b3e5b02b059179ec71c95177a0fd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lauri=20V=C3=B5sandi?= Date: Thu, 13 Apr 2017 18:17:05 +0300 Subject: [PATCH] Fix OpenVPN client configuration generation --- certidude/cli.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/certidude/cli.py b/certidude/cli.py index ef17beb..857f9ce 100755 --- a/certidude/cli.py +++ b/certidude/cli.py @@ -108,14 +108,6 @@ def certidude_request(fork, renew): except NoOptionError: pass - try: - endpoint_port = service_config.getint(endpoint, "port") - except NoOptionError: - endpoint_port = 1194 - try: - endpoint_proto = service_config.get(endpoint, "proto") - except NoOptionError: - endpoint_proto = "udp" try: endpoint_insecure = clients.getboolean(authority, "insecure") except NoOptionError: @@ -247,6 +239,15 @@ def certidude_request(fork, renew): # OpenVPN set up with NetworkManager if service_config.get(endpoint, "service") == "network-manager/openvpn": + try: + endpoint_port = service_config.getint(endpoint, "port") + except NoOptionError: + endpoint_port = 1194 + try: + endpoint_proto = service_config.get(endpoint, "proto") + except NoOptionError: + endpoint_proto = "udp" + # NetworkManager-strongswan-gnome nm_config_path = os.path.join("/etc/NetworkManager/system-connections", endpoint) if os.path.exists(nm_config_path): click.echo("Not creating %s, remove to regenerate" % nm_config_path)