iOS currently tears down the VPN connection when an iPad or iPhone goes into sleep mode. I would like to determine on the server if the connection to the server was disconnected because the mobile device went to sleep or if the user specifically disconnected from the VPN server. Same on re-connect, was the connection established by the user, or was it the device waking up.
From the server logs now I can't determine why either event happened. Both user or iOS initiated connect/disconnect events look like a "soft, connection-reset." I don't mind modifying the server code but am not sure if the connect/disconnect reason is even passed to the server from the client.
I also don't mind modifying the OpenVPN Connect iOS code to pass up the connect/disconnect reason but can't find the code anywhere. I'm pretty sure it's not open source due to Apple's control of the VPN API's. But I figured I'd ask here in case someone knew where to get it.
Thanks in advance!
iOS Disconnect Reason
-
- OpenVpn Newbie
- Posts: 2
- Joined: Sun Mar 30, 2014 7:49 pm
Re: iOS Disconnect Reason
Just to follow up. I added some code to the server in mult.c, multi_client_disconnect_script to see what information was in the context signal struct. As I suspected the openvpn connect client doesn't seem to send any information as to why the connection was disconnected. The signal_received int was set to 10 and hard was set to 0 when the connection was torn down by the user and an iOS sleep event.
Any additional ideas on how I could possibly get why the connection was shut down?
Any additional ideas on how I could possibly get why the connection was shut down?