Bug 501544

Summary: Importing a WireGuard configuration file, with a filename longer than 15 characters or with spaces, fails with an error that it's not a valid OpenVPN configuration file
Product: [Plasma] plasmashell Reporter: Musikolo <musikolo>
Component: Networks widgetAssignee: Plasma Bugs List <plasma-bugs>
Status: CONFIRMED ---    
Severity: normal CC: john.kizer, keyboardsquid, nate
Priority: NOR    
Version First Reported In: master   
Target Milestone: 1.0   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Fake, but valid, Wireguard configuration file

Description Musikolo 2025-03-15 16:07:51 UTC
Created attachment 179432 [details]
Fake, but valid, Wireguard configuration file

SUMMARY
Importing a WireGuard conf file fails when any of the following conditions occurs:
- The filename exceeds 15 characters long.
- The filename contains blanks.

STEPS TO REPRODUCE
1. Create a WireGuard conf file and save it as vpn.conf. You can also use the attached fake vpn.conf file.
2. Go to NetworkManager editor and click on the plus sign to "Add a new connection".
3. Choose the "Import VPN connection..." option at the bottom within the Other section. 
4. This will succeed. 
5. Rename the file as "123456789123456.conf" and repeat steps 1 to 3. It should show an error with the message "Failed to import VPN connection: The file to import wasn’t a valid OpenVPN client configuration".
6. Rename the file as "12345678912345.conf" and repeat steps 1 to 3. It should  work! 
7. Rename the file as "vpn 1.conf" and repeat steps 1 to 3. It should fail with the same error message as in step 5.

OBSERVED RESULT
Only when filenames don't contain blanks and are 15 or less characters long, importing conf files succeeds. 

EXPECTED RESULT
It should work with any filename of any length supported by the OS.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Archlinux
KDE Plasma Version: 6.3.3
KDE Frameworks Version: 6.11.0
Qt Version: 6.8.2

ADDITIONAL INFORMATION
Kernel version: 6.13.6-arch1-1 (64-bit)
Graphics Platform: Wayland
Comment 1 John Kizer 2025-03-28 04:52:17 UTC
Hi - I can reproduce this on Fedora KDE 41. Thanks!
Comment 2 keyboardsquid 2025-09-15 23:51:09 UTC
Confirming that this is still present in the following version: 

Operating System: Fedora Linux 42
KDE Plasma Version: 6.4.4
KDE Frameworks Version: 6.17.0
Qt Version: 6.9.1
Kernel Version: 6.16.4-200.fc42.x86_64 (64-bit)
Graphics Platform: Wayland
KDE Settings Version: 42.0-3.fc42

Seems like a filename parsing issue.
When shortening the character count to less than 15 characters, it properly identifies it as a Wireguard.conf

Possible solutions: 
-- Separate Import options for the different VPN Types so the user can select what they are importing
-- A popup that says Wireguard Config names need to be less than 15 characters and no whitespaces (this seems to be a WG requirement)