Page 1 of 1

Issue on failed VPN Server

Posted: Sun Feb 05, 2017 10:27 pm
by StuartM
On occasions my VPN provider has a server fail and random chance is such that I also happen to try and connect through that server (e.g. on resume from sleep).

When this happens, Viscosity pops up an "Authentication Failed" dialog (as is reasonable) and when you dismiss that to retries and then pops-up an "Authentication Failed" dialog, which you dismiss, etc. And this continues until you go into the connections menu (from the menubar icon) and "disconnect" the failing connection.

Except, the problem is that the time between "Authentication Failed" dialogs is short enough that it is really difficult to get into the menubar icon, to the connection and to select the connection (to "disconnect") before the next "Authentication Failed" dialog after which you have to start again.

Is there some way to globally configure an auto-disconnect after a number of failed connection attempts or some way to add a "Disconnect connection" button to the "Authentication Failed" dialog. Maybe I'm a bit slow but it can take me quite a few attempts to get to the disconnect even with an external mouse (easier) and with the built-in trackpad (slower) it's "a real challenge" (for me).

Re: Issue on failed VPN Server

Posted: Mon Feb 06, 2017 6:24 pm
by James
Hi StuartM,

You’ll most likely want to adjust OpenVPN’s reconnect behaviour when a connection attempt fails. OpenVPN’s reconnect behaviour can be customised using advanced OpenVPN commands like "connect-retry”, "ping-restart”, "remap-usr1”, etc. For example, in this case you may want to use something like "remap-usr1 SIGTERM" (without the quotes) to prevent further connection attempts when an attempt fails or an error connecting occurs.

OpenVPN commands can be added using the Advanced commands area for your connection/s:
http://www.sparklabs.com/support/kb/art ... n-commands

Cheers,
James

Re: Issue on failed VPN Server

Posted: Mon Feb 06, 2017 10:08 pm
by StuartM
connect-retry looks ideal.

Is there any way I can apply this globally (i.e. to all connections). I have over 270 configured connections so not keen of running through each one.

Stuart

Re: Issue on failed VPN Server

Posted: Thu Feb 09, 2017 6:22 pm
by James
Hi Stuart,

I'm afraid not using Viscosity directly. Connection folders support sharing authentication details and scripts, however I'm afraid not Advanced commands. However we'll take it on board as a feedback idea.

You can however use a bulk text edit/replacement tool, or a small shell script, to add your command to all of your connection configuration files directly (and then restart Viscosity). Viscosity's configuration files for your connections can be found at "Your Home Folder/Library/Application Support/Viscosity/OpenVPN".

The Library folder is hidden under modern versions of macOS. To get to it you'll need to open the "Go" menu in the Finder while holding down the Option key on your keyboard and click the Library item. Your Library folder will open.

Cheers,
James