aboutsummaryrefslogtreecommitdiffstats
path: root/config/openvpn-client-export
diff options
context:
space:
mode:
Diffstat (limited to 'config/openvpn-client-export')
-rwxr-xr-xconfig/openvpn-client-export/openvpn-client-export.inc30
-rwxr-xr-xconfig/openvpn-client-export/openvpn-client-export.xml12
2 files changed, 29 insertions, 13 deletions
diff --git a/config/openvpn-client-export/openvpn-client-export.inc b/config/openvpn-client-export/openvpn-client-export.inc
index 4d6ded8f..1a34c260 100755
--- a/config/openvpn-client-export/openvpn-client-export.inc
+++ b/config/openvpn-client-export/openvpn-client-export.inc
@@ -236,7 +236,8 @@ function openvpn_client_export_config($srvid, $usrid, $crtid, $useaddr, $verifys
if (!empty($proxy)) {
if ($proxy['proxy_type'] == "http") {
- if ($proto == "udp") {
+
+ if (strtoupper(substr($settings['protocol'], 0, 3)) == "UDP") {
$input_errors[] = "This server uses UDP protocol and cannot communicate with HTTP proxy.";
return;
}
@@ -344,7 +345,7 @@ function openvpn_client_export_config($srvid, $usrid, $crtid, $useaddr, $verifys
$conf .= "management-hold{$nl}";
$conf .= "# query management channel for user/pass{$nl}";
$conf .= "management-query-passwords{$nl}";
- $conf .= "# disconnect VPN when managment program connection is closed{$nl}";
+ $conf .= "# disconnect VPN when management program connection is closed{$nl}";
$conf .= "management-signal{$nl}";
$conf .= "# forget password when management disconnects{$nl}";
$conf .= "management-forget-disconnect{$nl}";
@@ -629,7 +630,7 @@ function viscosity_openvpn_client_config_exporter($srvid, $usrid, $crtid, $usead
file_put_contents("{$tempdir}/{$proxy['passwdfile']}", $pwdfle);
}
- $conf = openvpn_client_export_config($srvid, $usrid, $crtid, $useaddr, $verifyservercn, $randomlocalport, $usetoken, true, $proxy, "baseconf", "", true, $openvpnmanager, $advancedoptions);
+ $conf = openvpn_client_export_config($srvid, $usrid, $crtid, $useaddr, $verifyservercn, $randomlocalport, $usetoken, true, $proxy, "baseconf", $outpass, true, true, $openvpnmanager, $advancedoptions);
if (!$conf)
return false;
@@ -733,7 +734,10 @@ function openvpn_client_export_sharedkey_config($srvid, $useaddr, $proxy, $zipco
} else {
if (!$interface)
$interface = "wan";
- $server_host = get_interface_ip($interface);
+ if (in_array(strtolower($settings['protocol']), array("udp6", "tcp6")))
+ $server_host = get_interface_ipv6($interface);
+ else
+ $server_host = get_interface_ip($interface);
}
} else if ($useaddr == "serverhostname" || empty($useaddr)) {
$server_host = empty($config['system']['hostname']) ? "" : "{$config['system']['hostname']}.";
@@ -742,7 +746,10 @@ function openvpn_client_export_sharedkey_config($srvid, $useaddr, $proxy, $zipco
$server_host = $useaddr;
$server_port = $settings['local_port'];
- $proto = (strtoupper($settings['protocol']) == 'UDP' ? 'udp' : "tcp-client");
+
+ $proto = strtolower($settings['protocol']);
+ if (strtolower(substr($settings['protocol'], 0, 3)) == "tcp")
+ $proto .= "-client";
$cipher = $settings['crypto'];
$digest = !empty($settings['digest']) ? $settings['digest'] : "SHA1";
@@ -837,7 +844,10 @@ function openvpn_client_export_build_remote_lines($settings, $useaddr, $interfac
} else {
if (!$interface || ($interface == "any"))
$interface = "wan";
- $server_host = get_interface_ip($interface);
+ if (in_array(strtolower($settings['protocol']), array("udp6", "tcp6")))
+ $server_host = get_interface_ipv6($interface);
+ else
+ $server_host = get_interface_ip($interface);
}
} else if ($useaddr == "serverhostname" || empty($useaddr)) {
$server_host = empty($config['system']['hostname']) ? "" : "{$config['system']['hostname']}.";
@@ -845,7 +855,10 @@ function openvpn_client_export_build_remote_lines($settings, $useaddr, $interfac
} else
$server_host = $useaddr;
- $proto = (strtoupper($settings['protocol']) == 'UDP' ? 'udp' : "tcp");
+ $proto = strtolower($settings['protocol']);
+ if (strtolower(substr($settings['protocol'], 0, 3)) == "tcp")
+ $proto .= "-client";
+
if (($expformat == "inlineios") && ($proto == "tcp-client"))
$proto = "tcp";
@@ -867,6 +880,9 @@ function openvpn_client_export_find_port_forwards($targetip, $targetport, $targe
filter_generate_optcfg_array();
$destinations = array();
+ if (!is_array($config['nat']) || !is_array($config['nat']['rule']))
+ return $destinations;
+
foreach ($config['nat']['rule'] as $natent) {
$dest = array();
if (!isset($natent['disabled'])
diff --git a/config/openvpn-client-export/openvpn-client-export.xml b/config/openvpn-client-export/openvpn-client-export.xml
index 0af838e9..a6a46649 100755
--- a/config/openvpn-client-export/openvpn-client-export.xml
+++ b/config/openvpn-client-export/openvpn-client-export.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
<packagegui>
<name>OpenVPN Client Export</name>
- <version>1.2.4</version>
+ <version>1.2.9</version>
<title>OpenVPN Client Export</title>
<include_file>/usr/local/pkg/openvpn-client-export.inc</include_file>
<backup_file></backup_file>
@@ -22,27 +22,27 @@
<additional_files_needed>
<prefix>/usr/local/pkg/</prefix>
<chmod>077</chmod>
- <item>http://www.pfsense.com/packages/config/openvpn-client-export/openvpn-client-export.inc</item>
+ <item>https://packages.pfsense.org/packages/config/openvpn-client-export/openvpn-client-export.inc</item>
</additional_files_needed>
<additional_files_needed>
<prefix>/usr/local/pkg/</prefix>
<chmod>077</chmod>
- <item>http://files.pfsense.com/packages/openvpn-client-export/openvpn-client-export.tgz</item>
+ <item>https://files.pfsense.org/packages/openvpn-client-export/openvpn-client-export.tgz</item>
</additional_files_needed>
<additional_files_needed>
<prefix>/usr/local/www/</prefix>
<chmod>077</chmod>
- <item>http://www.pfsense.com/packages/config/openvpn-client-export/vpn_openvpn_export.php</item>
+ <item>https://packages.pfsense.org/packages/config/openvpn-client-export/vpn_openvpn_export.php</item>
</additional_files_needed>
<additional_files_needed>
<prefix>/usr/local/www/</prefix>
<chmod>077</chmod>
- <item>http://www.pfsense.com/packages/config/openvpn-client-export/vpn_openvpn_export_shared.php</item>
+ <item>https://packages.pfsense.org/packages/config/openvpn-client-export/vpn_openvpn_export_shared.php</item>
</additional_files_needed>
<additional_files_needed>
<prefix>/etc/inc/priv/</prefix>
<chmod>077</chmod>
- <item>http://www.pfsense.com/packages/config/openvpn-client-export/openvpnexport.inc</item>
+ <item>https://packages.pfsense.org/packages/config/openvpn-client-export/openvpnexport.inc</item>
</additional_files_needed>
<custom_php_install_command>
openvpn_client_export_install();