Open maurin-at-homiwoo opened 11 months ago
This is a fair suggestion. It's not something OpenVPN 3 Linux can do out-of-the-box today. But it should be able compare the configuration path of the just requested new tunnel against already running VPN sessions. Each VPN session has it's own D-Bus object which has this reference.
And that may actually be the quickest fix for your applet as well ... A very quick Python based PoC of gathering the configuration paths currently running:
import dbus
import openvpn3
bus = dbus.SystemBus()
sm = openvpn3.SessionManager(bus)
running_configs = [str(session.GetProperty('config_path')) for session in sm.FetchAvailableSessions()]
Currently it is possible to have multiple session opened to the same server, which break the connection as the system seems to not know which one to use.
To reproduce, simply execute multiple time
openvpn3 session-start --config my-config
In this case you end up with something like :
(It actually happen in our case because of a small applet we are using to manage the connection, the applet doens't support MFA with challenge yet so it tries to connect with only the password, the connection fails because of the missing token, we connect with the command line, fill in the MFA, get a connection, and a few seconds later the applet succeed to connect). But that could also happen if someone is using any type of script to auto connect and there's a failure or anything like this.
Is there an easy way to prevent openvpn3 to connect again if there's already a connection establish with a given server ?
Thanks !