Import .ovpn to Iphone via URL

Official client software for OpenVPN Access Server and OpenVPN Cloud.
Post Reply
ionasOHG
OpenVpn Newbie
Posts: 9
Joined: Fri Oct 17, 2014 10:21 am

Import .ovpn to Iphone via URL

Post by ionasOHG » Fri Oct 17, 2014 10:26 am

Hi everybody,
please help me. I want to import an ovpn file to the iphone via url from my local webserver.

I know that it is possible because I found a page where it works: http://www.vpngate.net/en/do_openvpn.as ... 3&hid=6186
After open the offered ovpn file with safare the iphone offers to open the file with openvpn app.

If I try to do this with nginx webserver my iphone always opens the file and shows me the content.
After analysing the code of vpngate.net I recognised that they use a kind of downloading script. That means they don't open the ovpn file directly but the use:

a href="...openvpn_download.aspx?...&vpngate_118.108.96.82_udp_1194.ovpn"

I tried already to create a php file and to manipulate the header() entries but without success.
Please help me!

Thanks and best regards
Christoph

chayakornc
OpenVpn Newbie
Posts: 2
Joined: Tue Nov 11, 2014 6:47 am

Re: Import .ovpn to Iphone via URL

Post by chayakornc » Tue Nov 11, 2014 6:56 am

example php code

Code: Select all

$file = 'full path/file.ovpn';  //os directory path not web path
header('Content-type: application/ovpn');
header("Content-Disposition: attachment; filename=\"config.ovpn\"");
readfile($file);
sorry my english.

ionasOHG
OpenVpn Newbie
Posts: 9
Joined: Fri Oct 17, 2014 10:21 am

Re: Import .ovpn to Iphone via URL

Post by ionasOHG » Wed Nov 12, 2014 6:31 am

hi chayakornc,

thanks for your reply. It tried this already but it didn't worked. For a Android Phone I tried it worked but my iPhone always asked me how to open it.

Currently I solved it differently. I added the following line to the /etc/nginx/mime.types:

Code: Select all

application/x-openvpn-profile       ovpn;
If somebody has questions to my solution, please contact me via the phone number of my homepage: http://www.ionas.com.
Best regards
Christoph

chayakornc
OpenVpn Newbie
Posts: 2
Joined: Tue Nov 11, 2014 6:47 am

Re: Import .ovpn to Iphone via URL

Post by chayakornc » Thu Nov 13, 2014 4:59 am

hi ionasOHG,

I didn't test Android phone.
Thanks for your answer to resolved.

hansooloo
OpenVpn Newbie
Posts: 10
Joined: Wed Jun 05, 2013 5:36 pm

Re: Import .ovpn to Iphone via URL

Post by hansooloo » Tue Dec 02, 2014 12:01 pm

ionasOHG wrote:hi chayakornc,

thanks for your reply. It tried this already but it didn't worked. For a Android Phone I tried it worked but my iPhone always asked me how to open it.

Currently I solved it differently. I added the following line to the /etc/nginx/mime.types:

Code: Select all

application/x-openvpn-profile       ovpn;
If somebody has questions to my solution, please contact me via the phone number of my homepage: http://www.ionas.com.
Best regards
Christoph
Probably because your nginx is taking care of the HTTP session headers and not paying attention to what comes from PHP.


Sent from my iPad using Tapatalk

Post Reply