Hi,
I am working on the Watchguard SSL VPN AddOn.
It's a very basic implementation, because of the limited client, but it could be sufficient. However, since the client itself does not have any kind of interface (API/SDK or CLI) I cannot close the session nicely. So when someone has a working VPN session and want to close it by using RDM, I somehow need to terminate the process.
When I do that by just say process.Kill() RDM crashes and so does my entire Windows (BSOD).
So I tried to Break() before doing the dirty stuff, but then RDM gives me an error telling me that I cannot use breakpoints and crashes... and so does Windows.
Any ideas on how to do this nicely?
Cheers!
Sjoerd
Hi,
Have you tried to send a Close message instead?
WinAPI.PostMessage(this.MainWindowHandle, WM_CLOSE, 0, 0);
Something like that. Could you verify if the VPN spawn another process?
David Hervieux
David,
How do I get the handle of my process.
In the Open() method I return a VPNOpenResult with the process. That contains the handle.
But when Close() hits, RDM does not give me access to this process object.
Cheers!
Sjoerd
Could you find it with Process.GetProcesses?
David Hervieux
I will try. Using that causes the crash... or maybe the .Kill() later on... ;)
I will let you know.
Cheers!
Sjoerd
David,
Closing the Window is not working. Looked for solutions but nothing seems to be working. But in fact in does not really matter, because when I would have been succesfull in closing the window the trayprogram still exists.
So killing the application is the only way.
When I try to do this in the AddOn everything crashes.
When I do it in a test application, it works just fine.
try
{
var processes = Process.GetProcesses();
foreach (Process prc in processes)
{
if (prc.ProcessName.StartsWith("wgssl"))
{
Console.WriteLine("{0} handle={1}", prc.ProcessName, prc.Handle);
Console.WriteLine("Trying to kill {0}", prc.ProcessName);
prc.Kill();
}
}
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
Any ideas?
Cheers!
Sjoerd
David,
It's working now. I guess their was something wrong with my earlier implementation...
I will send you the Addin as soon as it has been fine-tuned.
Cheers!
Sjoerd
David,
Here you go, the version 1.0 of the VPN SSL Add-On.
http://dl.dropbox.com/u/11320544/WatchguardSSLVpnAddOn_1.0.zip
Hope it helps the Watchguard users out there.
Including me...
It will change the host and username in the registry, then start the client.
It cannot automatically connect since the password cannot be set. You have to manually type this in.
bummer... Talked to Watchguard about this but they unfortunately do not have any form of automation on the client.
Cheers!
Sjoerd
Cool, André will add this tomorrow
David Hervieux
Hello Sjoerd
Im having trouble with the Watchguard SSL VPN Addon.
The Addon seems to fail to close the network adapter correctly. Thus the network is still open.
Watchguard uses openvpn. Would it not be more appropriate to terminate the openvpn.exe? When I do that manually from the Task Manager the network is closed properly.
Kind Regards
Magnus
Could you try to invoke the VPN command line to see if it fails?
rwscmd /disconnect
David Hervieux
David Im sorry, what do you mean? I don't have rwscmd, only WatchguardSSLVpnAddOn.dll
/Magnus
WatchguardSSLVpnAddOn.dll invoke the command line of Watchguard which is rwscmd .Do you have this installed?
David Hervieux
Magnus,
I could be that since I created the AddOn the SSL client of WG has been updated.
Perhaps they use a different client now. I'm currently not using the WG SSL client anymore so I do not have this issue obviously.
This is the current code when closing the connection:
var prc = Process.GetProcessesByName("wgsslvpnc");
if (prc.Length == 1) prc[0].Kill();
If you tell me it is in fact another client and exe that gets started then perhaps I need to refactor the AddOn.
Could you explain to me what gets started at the moment when you connect the VPN?
Cheers!
Sjoerd
Sjoerd
wgsslvpnc.exe and openvpn.exe is started and these processes are both stopped when a manual disconnect is issued using the watchguard menu in the taskbar.
When the WatchguardSSLVpnAddOn.dll addon is invoked using close session in RDM, only wgsslvpnc.exe is terminated.
I managed to use taskkill /f /im openvpn.exe but the force switch is needed.
The version of wgsslvpnc.exe is 11.4.0
/Magnus
I updated the AddOn to also kill openvpn.exe.a
You can download it here: https://dl.dropboxusercontent.com/u/11320544/WatchguardSSLVpnAddOn_1.0.1.zip
@David, could you please update the AddOn Manager?
edited by chanlerone on 4/22/2013
Cheers!
Sjoerd
I will ask André to do so.
David Hervieux
Hi,
It's done. Your new version is now available in the Add-on Manager or on the Website.
Regards,
André Sanscartier
Hi all
Tested it and it closes the vpn and network nicely.
Also it now doesnt reconnect 5 times if not connected at first.
Best Regards
Magnus Pettersson
Hello
Installed RDM 9.0.4 and watchguard ssl addon 1.0.2.0
I had a macro in the after connect to enter the password in the dialog.
It worked due to the slow execution of rdm7.6.0
Now with the blindingly fast RDM 9 I'm having problems getting enough delay between vpn execute and the calling RDP-session.
I suggest a feature in the after connection event. A checkbox telling RDM it should execute this event right after vpn invocation instead of after connection delay finished.
Would it be possible?
/Magnus
edited by magpet on 11/4/2013
Macro before Connection delay.jpg
watchguard connection.jpg
Hi Magnus,
Perhaps we could add a macro in the VPN directly instead?
David Hervieux
Sure, that would work fine.
I can test it for you.
/Magnus
Hi Devolution Team,
Where can I get the file RWSCMD.exe to download? It is not found in my installation folder.
Thanks.
Shiam
Hi,
Do you know if they replaced this executable by a new one?
Regards
David Hervieux