I am trying to learn and make a VPN app with WPF C# using my own OpenVPN server hosted on AWS VM instance.
But when I try to do it with my project I get the error
2023-07-18 14:49:27 OPTIONS IMPORT: --ifconfig/up options modified
2023-07-18 14:49:27 OPTIONS IMPORT: route options modified
2023-07-18 14:49:27 OPTIONS IMPORT: route-related options modified
2023-07-18 14:49:27 OPTIONS IMPORT: --ip-win32 and/or --dhcp-option options modified
2023-07-18 14:49:27 interactive service msg_channel=0
2023-07-18 14:49:27 NETSH: C:\WINDOWS\system32\netsh.exe interface ip set address 23 static 10.8.0.2 255.255.255.0
2023-07-18 14:49:27 ERROR: command failed: returned error code 1
Here is my code trying to connect to the server when the button is clicked.
ConnectCommand = new RelayCommand(o =>
{
ConnectionStatus = "Connecting...";
Process process = new Process();
ProcessStartInfo startInfo= new ProcessStartInfo();
startInfo.FileName = @"C:\Program Files\OpenVPN\bin\openvpn.exe";
startInfo.Arguments = "--config sgudp.ovpn";
startInfo.Verb = "runas";
process.StartInfo = startInfo;
process.Start();
});
I can connect to it using OpenVPN client, it works. So, at least I know it is not the server issue. I just can't connect to it using my project.