I'd like to start OpenVPN to connect to our OpenVPN server (on Debian) through my aplication in C++. Currently, I'm using key files only (public & private keys), but I need to add username authentication as well. I'm newbie in C++, so I would be grateful if you explain in details and all steps I need to take.
I also need to disconnect the VPN connection before quittig my application, and to avoid communicating when VPN is disconnected (to handle abrupt disconnections). So I also need a mechanism to detect VPN disconnections or to check if the OpenVPN connection is still in place, before sending sensitive data.
Thank you all.