Bug 427796

Summary: [Openconnect] Extra space before the gateway breaks the config
Product: [Applications] systemsettings Reporter: erik_hahn
Component: kcm_networkmanagementAssignee: Jan Grulich <jgrulich>
Status: REPORTED ---    
Severity: normal CC: jgrulich
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description erik_hahn 2020-10-16 11:10:21 UTC
SUMMARY
If you paste a gateway address with an extra space at the start, the editor does not strip it and the connection fails. Editing the config to remove the space has no effect either.


STEPS TO REPRODUCE
1. Create a new VPN connection of type "Cisco AnyConnect Compatible VPN (openconnect). Add an extra space before the gateway address.
2. Try to connect.
3. After that fails, open the config, remove the extra space, and try again.

OBSERVED RESULT
Both times you try to connect, you get an error message like the following:

POST https://vpn.example.com/
getaddrinfo failed for host ' vpn.example.com': Name or service not known
Failed to open HTTPS connection to vpn.example.com

If you open the config again, the extra space is still there.



EXPECTED RESULT
plasma-nm should strip the extra space when creating or editing the config. At least if you remove the space manually, it shouldn't ignore that change


SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: Kubuntu 20.04, Kernel 5.4.0-48-generic
(available in About System)
KDE Plasma Version: 5.18.5
KDE Frameworks Version: 5.68.0
Qt Version: 5.12.8

ADDITIONAL INFORMATION