Page 1 of 1

Import .ovpn to Iphone via URL

Posted: Fri Oct 17, 2014 10:26 am
by ionasOHG
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

Re: Import .ovpn to Iphone via URL

Posted: Tue Nov 11, 2014 6:56 am
by chayakornc
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.

Re: Import .ovpn to Iphone via URL

Posted: Wed Nov 12, 2014 6:31 am
by ionasOHG
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

Re: Import .ovpn to Iphone via URL

Posted: Thu Nov 13, 2014 4:59 am
by chayakornc
hi ionasOHG,

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

Re: Import .ovpn to Iphone via URL

Posted: Tue Dec 02, 2014 12:01 pm
by hansooloo
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