OpenVPN - enable automatic authentication => password error

OpenVPN - enable automatic authentication => password error

avatar

I am using "OpenVPN 2.4.4 x86_64-w64-mingw32 [SSL (OpenSSL)] [LZO] [LZ4] [PKCS11] [AEAD] built on Sep 26 2017" and use the last plugin version (2.5.1.0).

The automatic authentication fails and gives me a authentication error. When supplying the password manually it all works fine.

When the username and password are typed I hear the automatic authentication giving an 'errorlike' sounds. I guess it received a key-combo which isn't 100% ok. I also notice the 'Save Password' options gets the focus and not the button.

I have the log file (replaced IP with 88.88.88.88) and created a small video of the issue.


We have lots of small issue's like this one, and i will try to report them all on the forum ;)
[we use many different VPN's to login to customers]

Zip file with video + log file can be found here: https://www.sendspace.com/file/cc5dy3

All Comments (18)

avatar

Hello,

I think what may be happening is that the username is already filled in so the focus automatically goes to the password field. RDM expects the username field to be selected. This means that the username is typed in the password field and the password is typed into the checkbox...which makes the "error" sound.
Can you confirm that when you try and connect to your OpenVPN server, the username is already filled in and the focus is on the password field?

Regards,

Hubert Mireault

avatar

Hey Hubert,

Thanks for the support. You are 100% correct.
The username is already present and causing issue's. I noticed it does work on a clean install first time ; and second time doesn't work.

Is this something which can be fixed? Or do I need to change some configuration client-side?

avatar

I don't think this is something we can fix gracefully. It is something we can make an option for, but since we can't detect which field is selected, it would either work when the username field is selected or when the password field is selected, not with both at once.
If you think adding an option to send only the password would still be prefered, we can definitely add it.

The test OpenVPN entries we have here don't save the username, so I think this might be a server config thing, if you want to work around the issue this way.

Regards,

Hubert Mireault

avatar

Hey Hubert,
I fixed it by adding the following pre-connect script:




(wait for exit + run as admin)
Maybe this is something you could add as a new option of the plugin?

avatar

Good catch! :)

We can totally add this for an option, somewhat like the one to kill the OpenVPN process before opening. We'll put this on our todo list.

Regards,

Hubert Mireault

avatar

I think the option is added... however it gives an Exception when the key is not present:


ArgumentException - No value exists with that name.
at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
at Microsoft.Win32.RegistryKey.DeleteValue(String name)
at RemoteDesktopManager.AddOn.OpenVPNAddOn.OpenVPNAddOn.Open(String parameters)
at Devolutions.RemoteDesktopManager.Business.VPNOpeners.VPNAddOnOpener.Open(Connection vpn)
at Devolutions.RemoteDesktopManager.Managers.VPNManager.OpenVPN(Connection connection)
at Devolutions.RemoteDesktopManager.Business.Connectors.VPNConnector.Connect(Connection connection, OpenConnectionMode openConnectionMode)
at Devolutions.RemoteDesktopManager.Managers.ConnectionManager.OpenConnection(Connection connection, OpenConnectionParameter parameter)
at Devolutions.RemoteDesktopManager.Managers.ConnectionManager.OpenConnections(Connection[] connectionList, OpenConnectionParameter parameter)
at Devolutions.RemoteDesktopManager.Managers.ActionManager.OpenConnections(OpenConnectionMode openConnectionMode, IConnectionSource source, Boolean checkOpenedConnection)
at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ToolStrip.WndProc(Message& m)
at System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

avatar

Hello,

Thanks for letting us know, we'll fix this today.

Regards,

Hubert Mireault

avatar

Having the same issue (username is prefilled and entering credentials starts at password field).
Checking the option 'Clear saved credentials before opening' makes no difference.

In OpenVPNAddon.dll (and from stacktrace above) I see:

registryKey.DeleteValue(openVPNConfiguration.Name);

Shouldn't it delete a key instead of a value?

registryKey.DeleteSubKey(openVPNConfiguration.Name);

Key that should be deleted is server name or ip.

avatar

Sidenote: Can't the plugin first erase the content which is filled in in the password ; before keying the value ( = extra key DELETE after first tab?).

avatar

Hi all,

having the same problem. I would also support the idea to clear username AND password before it is refilled automatically. Btw: the 'remember creds' - option is by default 'opt in'.

Since OpenVPN stores all profile in HKCU\Software\OpenVPN-GUI\configs\ (Sander Verhoeven) - My workaround so far is:
Disable the 'automatic authentication'; start the vpn-connection once; fill in the creds manually; leaving the 'remember creds' opt in.
This way the connection is starting up fast BUT one has to manually click the 'ok'-button on every connection in the the openvpn-gui.

avatar

Hello,

I attached a new version of the add-on to this post. We've implemented Ralf's changes to this version. Sander and Saro, could you try and see if this helps in your case? The reason we do it this way is because there's no way for RDM to know which field the focus will start on, so the only way to make sure is by clearing the registry key.


Regards,

Samuel Baker

OpenVPNAddOn.zip

avatar

Works like a charm!

avatar

Yes - same here - works perfectly! thx a lot!

avatar

Thanks for fixing the issue, we received updates for the plugin.

One thing we noticed however was that closing the connection from RemoteDesktopManager does not kill the connection with the released plugin.
It kills openvpn-gui.exe, but not openvpn.exe (OpenVPN Daemon). Both are started when connection is opened.

Looking at the code of the attached plugin above, I see that it has a different implementation for killing the connection.
Released plugin only kills openvpn-gui, but the attached example kills everything with 'openvpn' in its name.
Which maybe is a little too much, it also kills the service 'OpenVPNServiceInteractive' => openvpnserv.exe (which I don't mind).


Do you have plans to modify the implementation of closing the connection?

avatar

Hello,

This is an unintended side effect of a few changes we've made recently. Samuel is currently looking at this issue.

Regards,

Hubert Mireault

avatar

Thanks for the quick reply.

avatar

Hi,

We've updated OpenVPN AddOn and the process should close like it used to.

Regards,

Samuel Baker

avatar

Just updated and works perfectly. Thanks!