Error When Creating New VPN Client (Undefined array key "client-to-client")

Dear VitalPBX Community,

I am encountering an error when trying to create a new VPN client through the VitalPBX graphical interface. The issue specifically arises when I click “Save” or “Apply” after filling in the details for a new OpenVPN client.

The exact error message displayed is:

An exception occurred
Exception: Undefined array key "client-to-client" in file /usr/share/vitalpbx/www/modules/vpn_server/OpenVPN.php on line 0

And the full error trace:

Error Trace
#	File	Function
1	/usr/share/vitalpbx/www/index.php:0	app\Core->run(...args);
2	/usr/share/vitalpbx/www/includes/app/Core.php:0	app\Core->_loadModule(...args);
3	/usr/share/vitalpbx/www/includes/app/Core.php:0	app\Core->loadModuleAction(...args);
4	/usr/share/vitalpbx/www/modules/vpn_server/vpn_server.php:0	modules\vpn_server\vpn_server->putClient(...args);
5	/usr/share/vitalpbx/www/modules/vpn_server/OpenVPN.php:0	modules\vpn_server\OpenVPN->configureClient(...args);
6	/usr/share/vitalpbx/www/modules/vpn_server/OpenVPN.php:0	modules\vpn_server\OpenVPN->getServerConf(...args);
7	/usr/share/vitalpbx/www/modules/vpn_server/OpenVPN.php:0	{closure}(...args);

VitalPBX Version: 4.5.1-4
PBX Engine 20.15.0-1
VPN Server Module Version: 4.5.0-2

Steps to Reproduce:

  1. Access the VitalPBX GUI.
  2. Navigate to the VPN Server module.
  3. Click “Add New VPN Client.”
  4. Fill in the required information (name, type, etc.).
  5. Click “Save” or “Apply.”

Expected Behavior:
The new VPN client should be created successfully, and configurations should be applied without errors.

Current Behavior
The “Undefined array key “client-to-client”” exception occurs, and the VPN client is not created.

It appears that an array key “client-to-client” is not defined at some point in the OpenVPN configuration or in how VitalPBX interacts with this configuration. Line 0 in the OpenVPN.php file suggests the problem might be in how data is read or accessed.

Any assistance or guidance to resolve this issue would be greatly appreciated.

Thank you!
Luciano Moreira
Lógic Digital