Page 1 of 1

How to detect / set VPN connection?

Posted: 27.07.2012, 14:50
by hstijnen
Hi,

I've a database on an external server. Before connecting to the database I have to setup a VPN connection to the server.

Is it possible with ZEOS to detect if the VPN connection exists or to make the connection?

Thanks for help

Posted: 27.07.2012, 16:33
by marsupilami
Hello hstijnen,

I think this is not the scope of database connection components. As far as I know there is no common mechanism to know if a VPN connection has been made because there are a lot of different kinds of VPNs.
In Windows most VPN Connections install their own virtual network card. Maybe you can check if these cards signal they have a connection. Or your VPN solution has some kind of an API where you can check this.
You also could decide to skip the VPN solution and use some solution like stunnel. stunnel will create the connection automatically when your application connects to it.
Best regards,

Jan

Posted: 08.10.2012, 23:08
by mdaems
hstijnen,

Simplest solution would be to try opening the connection and intercept the error message. Probably it will say something like 'host not found' when the VPN connection is not available. At least I would think so, as otherwise it would not be very usefull to require a VPN when the server is publicly visible.

Mark