I tried running the openvpn plugin in the foreground like so:
which yielded all the debug during the connection phase, and I could see keepalive pings occurring. The VPN was up - I was able to ping the remote server. But then as the VPN automatically disconnected itself, I saw the following:
sudo OPENVPN_DEBUG=1 /usr/lib/NetworkManager/nm-openvpn-service
Searching through the networkmanager source, I found the "Connect timer expired, disconnecting" message in libnm-glib/nm-vpn-plugin.c, in the function connect_timer_expired(). This function is called from the following code snippet, in the same file:
** Message: Connect timer expired, disconnecting.
** Message: Terminated openvpn daemon with PID 21424.
Tue Jun 12 09:21:14 2012 us=793779 PO_WAIT[2,0] fd=5 rev=0x00000001 rwflags=0x0001 arg=0x7f30c66ce068
Tue Jun 12 09:21:14 2012 us=793833 event_wait returned 1
Tue Jun 12 09:21:14 2012 us=793862 I/O WAIT status=0x0040
Tue Jun 12 09:21:14 2012 us=793907 PID packet_id_free
Tue Jun 12 09:21:14 2012 us=794028 SSL alert (write): warning: close notify
Tue Jun 12 09:21:14 2012 us=794834 TCP/UDP: Closing socket
Tue Jun 12 09:21:14 2012 us=794889 Closing TUN/TAP interface
Tue Jun 12 09:21:14 2012 us=806547 SIGTERM[hard,] received, process exiting
This confirms that it should not be limited to just the openvpn plugin (in my case), or even specific VPN plugins, but rather all VPN plugins. It would also appear that for whatever reason, network manager either doesn't think the plugin has connected (seems unlikely, since the GUI definitely indicates successful connection), or that it's not killing that timer upon successful connection.
/* Add a timer to make sure we do not wait indefinitely for the successful connect. */
priv->connect_timer = g_timeout_add_seconds_full (G_PRIORITY_DEFAULT,