aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorPiBa-NL <pba_2k3@yahoo.com>2012-11-24 19:16:53 +0100
committerPiBa-NL <pba_2k3@yahoo.com>2012-11-24 19:16:53 +0100
commit5ca2674428e6e801ae829e0057b0aca0914d909b (patch)
treee86a5e055a9076e5881bfeb25c5f0e53cb7fd408 /config
parent139ee999295b3d99beb2dc933b037249463c3a8d (diff)
downloadpfsense-packages-5ca2674428e6e801ae829e0057b0aca0914d909b.tar.gz
pfsense-packages-5ca2674428e6e801ae829e0057b0aca0914d909b.tar.bz2
pfsense-packages-5ca2674428e6e801ae829e0057b0aca0914d909b.zip
openvpn-client-export, use certificate common-name in the exported files filenames.
Diffstat (limited to 'config')
-rwxr-xr-xconfig/openvpn-client-export/openvpn-client-export.inc11
1 files changed, 5 insertions, 6 deletions
diff --git a/config/openvpn-client-export/openvpn-client-export.inc b/config/openvpn-client-export/openvpn-client-export.inc
index 27ddaa87..2fc1147d 100755
--- a/config/openvpn-client-export/openvpn-client-export.inc
+++ b/config/openvpn-client-export/openvpn-client-export.inc
@@ -75,14 +75,13 @@ function openvpn_client_export_prefix($srvid, $usrid = null, $crtid = null) {
$prot = ($settings['protocol'] == 'UDP' ? 'udp' : $settings['protocol']);
$port = $settings['local_port'];
- $username = "";
- //$config['openvpn']['openvpn-server'];
+ $filename_addition = "";
if ($usrid && is_numeric($usrid))
- $username = "-".$config['system']['user'][$usrid]['name'];
- if ($crtid && is_numeric($crtid))
- $username = "-".$config['cert'][$crtid]['descr'];
+ $filename_addition = "-".$config['system']['user'][$usrid]['name'];
+ if ($crtid && is_numeric($crtid) && function_exists("cert_get_cn"))
+ $filename_addition = "-".cert_get_cn($config['cert'][$crtid]['crt']);
- return "{$host}-{$prot}-{$port}{$username}";
+ return "{$host}-{$prot}-{$port}{$filename_addition}";
}
function openvpn_client_pem_to_pk12($outpath, $outpass, $crtpath, $keypath, $capath = false) {