pfSense Gold Subscription

Author Topic: OpenVPN - Client Export - bad archive  (Read 1294 times)

0 Members and 1 Guest are viewing this topic.

Offline jupiters_spot

  • Newbie
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
OpenVPN - Client Export - bad archive
« on: April 01, 2012, 03:15:30 pm »
I recently installed pfSense 2.0.1-RELEASE (i386) on a Soekris net4801 with a compact flash drive.  I installed the package "OpenVPN Client Export Utility" and I am able to download the OVPN file from the "Configuration" link.  However, when I try the "Configuration archive" link, I get a 260 byte file that is not a valid archive.  I have uninstalled and reinstalled the Client Export package, but I get the same issue.  I need the p12 file that is usually in the configuration archive.

Two questions:
1) any ideas on what I can do to get the Client Export utility to generate a valid archive download/
2) failing that, can I get the p12 file directly from the pfSense file system?

Offline Nachtfalke

  • Hero Member
  • *****
  • Posts: 2753
  • Karma: +0/-0
    • View Profile
Re: OpenVPN - Client Export - bad archive
« Reply #1 on: April 01, 2012, 03:42:33 pm »
Choose another browser and/or completely delete the brwoser's cache.

Offline jupiters_spot

  • Newbie
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re: OpenVPN - Client Export - bad archive
« Reply #2 on: April 01, 2012, 09:34:30 pm »
I used three different browsers (Safari, Firefox, and SR Ware Iron (a Chrome-based browser)) on a new machine and still no luck.  I think I'm going to remove all vestiges of my OpenVPN configuration and start fresh.

Offline jupiters_spot

  • Newbie
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re: OpenVPN - Client Export - bad archive
« Reply #3 on: April 02, 2012, 06:41:24 pm »
SOLVED

I noticed that the zip file pfSense was trying to create was named "-udp-1194-config.zip".  That lead me to look at the PHP code that constructs the archive name (openvpn_export_config in openvpn_client_export.inc), and I found that it was constructing the archive name using (in part) the HOSTNAME of the pfSense instance (on the GUI at System>General Setup>Hostname).  The Hostname is not required on that screen and I had left my field blank, and creation of the OpenVPN configuration archive failed.  Once I specified a valid hostname I was able to export the client configuration without issues.

The fact that the OpenVPN Client Export script requires Hostname in order to work implies that either of the two changes should be implemented:
a) Hostname should become a required field, or
b) the code in openvpn-client-export.inc should be changed to work without a value in Hostname

As it stands, the code will not produce a valid archive if the Hostname field is blank.


Offline jupiters_spot

  • Newbie
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re: OpenVPN - Client Export - bad archive
« Reply #4 on: April 02, 2012, 09:58:59 pm »
Further data. 
When I attempted to export the client archive while having a blank hostname, I would get a malformed zip file of 260 bytes.  I just examined the contents of the file, and rather than a zip file or some other LZW output, it has plain text:

Warning: filesize(): stat failed for /tmp/-udp-1194-config.zip in /usr/local/www/vpn_openvpn_export.php on line 186

Warning: readfile(/tmp/-udp-1194-config.zip): failed to open stream: No such file or directory in /usr/local/www/vpn_openvpn_export.php on line 198

Offline jimp

  • Administrator
  • Hero Member
  • *****
  • Posts: 14990
  • Karma: +4/-0
    • View Profile
Re: OpenVPN - Client Export - bad archive
« Reply #5 on: April 04, 2012, 03:11:16 pm »
Try the latest revision of the package.
Need help fast? Commercial Support!

Co-Author of pfSense: The Definitive Guide. - Check the Doc Wiki for FAQs.

Do not PM for help!