From 060f98a49550838d35407006a8e57b71fab66eee Mon Sep 17 00:00:00 2001 From: jim-p Date: Thu, 1 Jul 2010 10:11:55 -0400 Subject: Ensure that we do not get two CA lines in the Viscosity config --- config/openvpn-client-export/openvpn-client-export.inc | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'config/openvpn-client-export') diff --git a/config/openvpn-client-export/openvpn-client-export.inc b/config/openvpn-client-export/openvpn-client-export.inc index c453b8e2..8d7d338b 100755 --- a/config/openvpn-client-export/openvpn-client-export.inc +++ b/config/openvpn-client-export/openvpn-client-export.inc @@ -423,6 +423,14 @@ function viscosity_openvpn_client_config_exporter($srvid, $usrid, $crtid, $usead if (!$conf) return false; + // We need to nuke the ca line from the above config if it exists. + $conf = explode("\n", $conf); + for ($i=0; $i < count($conf); $i++) { + if (substr($conf[$i], 0, 3) == "ca ") + unset($conf[$i]); + } + $conf = implode("\n", $conf); + $friendly_name = $settings['description']; $visc_settings = <<