Problem disconnecting OpenVpn
I am tring to connect a remote server via openvpn using C#. I am able to connect it successfully. but disconneecting seems to not work properly. Once I close my app, I am not able to access the internet. I got to manually disable the TAP Adapter and then enable to execute the app again. I checked my "route print" and yes Tap is coming ahead of internet and hence couldn't access net.
I connect using : openvpn –config client.ovpn --ca certificate.cer --auth-user-pass user.txt
On searching net for this issue, I found to use management to exit the openvpn safely. But I cannot make how to run the managemetn code. While start I added : openvpn --config ca.ovpn --ca cert.cer --management 127.0.0.1 12345 Then how to give SIGTERM signal to close the openvpn. In new cmd, I tried : openvpn --management-signal SIGTERM but things doesn't work. ???
Is their a solution to not use te --auth-user-pass <file>but pass the username & password form command line only ?
Can anyone guide me where am I going wrong in disconnecting. How to handle the managemetn-signal code. Which is the best way to disconnet from openvpn server. Can I also exit the openvpn itself ?
Kindly help me. Have searched a lot on internet and found some help but no sucess yet. Stuck on this issue.