From 2b2ae7a31046b64461177a531a586bc26bdfde28 Mon Sep 17 00:00:00 2001 From: johnaheadley Date: Thu, 1 Aug 2019 23:52:53 -0700 Subject: [PATCH] To fix: OpenVPN server wizard always asks to create a new CA (#3614) --- src/etc/inc/plugins.inc.d/openvpn/wizard.inc | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/etc/inc/plugins.inc.d/openvpn/wizard.inc b/src/etc/inc/plugins.inc.d/openvpn/wizard.inc index a4dd63b93..e1a7c823d 100644 --- a/src/etc/inc/plugins.inc.d/openvpn/wizard.inc +++ b/src/etc/inc/plugins.inc.d/openvpn/wizard.inc @@ -194,8 +194,20 @@ function step5_submitphpaction() function step6_stepbeforeformdisplay() { global $stepid, $config; + $no_internal_ca = true; - if (!empty($config['ca'])) { + if (empty($config['ca'])) { + $stepid++; + } else { + foreach ($config['ca'] as $ca) { + if (!empty($ca['prv'])) { + $no_internal_ca=false; + break; + } + } + } + + if ($no_internal_ca) { $stepid++; } } @@ -447,7 +459,7 @@ function step10_submitphpaction() if (!isset($_POST['generatetlskey']) && isset($_POST['tlsauthentication'])) { if (!strstr($_POST['tlssharedkey'], "-----BEGIN OpenVPN Static key V1-----") || !strstr($_POST['tlssharedkey'], "-----END OpenVPN Static key V1-----")) { - $input_errors[] = gettext("The field 'TLS Authentication Key' does not appear to be valid."); + $input_errors[] = gettext("The field 'TLS Authentication Key' does not appear to be valid."); } }