From 422243858bab08d21faf97b7d0f5badbc76f8612 Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Sun, 25 Aug 2013 23:32:11 -0700 Subject: Use OpenVPN Manager client management port if specified for the server concerned If the OpenVPN server has the client management port field specified, then use that port number when generating the OpenVPN Manager client config file, otherwise use the default of "166". See: forum.pfsense.org/index.php/topic,63668.0.html Discussion: https://github.com/jochenwierum/openvpn-manager/issues/17 Related pull request on pfsense repo: https://github.com/pfsense/pfsense/pull/783 --- config/openvpn-client-export/openvpn-client-export.inc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (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 ac006d20..1d1609ed 100755 --- a/config/openvpn-client-export/openvpn-client-export.inc +++ b/config/openvpn-client-export/openvpn-client-export.inc @@ -156,7 +156,7 @@ function openvpn_client_export_validate_config($srvid, $usrid, $crtid) { } elseif (($settings['mode'] == "server_tls") || (($settings['mode'] == "server_tls_user") && ($settings['authmode'] != "Local Database"))) { $cert = $config['cert'][$crtid]; if (!$cert) - $input_errors[] = "Could not find client certifficate."; + $input_errors[] = "Could not find client certificate."; } else $nokeys = true; @@ -316,11 +316,16 @@ function openvpn_client_export_config($srvid, $usrid, $crtid, $useaddr, $quotese if ($openvpnmanager) { + if (!empty($settings['client_mgmt_port'])) { + $client_mgmt_port = $settings['client_mgmt_port']; + } else { + $client_mgmt_port = 166; + } $conf .= $nl; $conf .= "# dont terminate service process on wrong password, ask again{$nl}"; $conf .= "auth-retry interact{$nl}"; $conf .= "# open management channel{$nl}"; - $conf .= "management 127.0.0.1 166{$nl}"; + $conf .= "management 127.0.0.1 {$client_mgmt_port}{$nl}"; $conf .= "# wait for management to explicitly start connection{$nl}"; $conf .= "management-hold{$nl}"; $conf .= "# query management channel for user/pass{$nl}"; -- cgit v1.2.3