diff --git a/src/opnsense/mvc/app/models/OPNsense/OpenVPN/OpenVPN.php b/src/opnsense/mvc/app/models/OPNsense/OpenVPN/OpenVPN.php index 72926339135..90cf4c0361e 100644 --- a/src/opnsense/mvc/app/models/OPNsense/OpenVPN/OpenVPN.php +++ b/src/opnsense/mvc/app/models/OPNsense/OpenVPN/OpenVPN.php @@ -133,12 +133,18 @@ public function performValidation($validateFullModel = false) $key . ".verify_client_cert" )); } - if ((string)$instance->{'auth-gen-token'} != '0' && (string)$instance->{'reneg-sec'} == '0') { + if (!empty((string)$instance->{'auth-gen-token'}) && (string)$instance->{'reneg-sec'} == '0') { $messages->appendMessage(new Message( gettext('A token lifetime requires a non zero Renegotiate time.'), $key . ".auth-gen-token" )); } + if ((string)$instance->{'auth-gen-token'} == '0' && (string)$instance->{'reneg-sec'} == '0') { + $messages->appendMessage(new Message( + gettext('Zero Renegotiate time requires empty token lifetime value.'), + $key . ".auth-gen-token" + )); + } } if (!empty((string)$instance->cert)) { $tmp = Store::getCertificate((string)$instance->cert);