Bug 274930 - NM 0.9 branch, cannot connect to the vpn (property 'user-name' invalid or not supported)
Summary: NM 0.9 branch, cannot connect to the vpn (property 'user-name' invalid or not...
Alias: None
Product: Network Management
Classification: Unclassified
Component: OpenVPN (show other bugs)
Version: 0.9
Platform: Fedora RPMs Linux
: NOR normal (vote)
Target Milestone: ---
Assignee: Will Stephenson
Depends on:
Reported: 2011-06-04 19:33 UTC by S.Trzmiel
Modified: 2011-07-19 03:54 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:

Script to get information about the VPN connection (1.11 KB, application/x-shellscript)
2011-06-04 23:24 UTC, Lamarque V. Souza
patch for testing (1.11 KB, patch)
2011-06-05 18:26 UTC, Ilia Kats
Test script output for plasma-nm (4.24 KB, text/plain)
2011-06-05 20:46 UTC, S.Trzmiel
Script output for the same connection under gnome nm-applet (3.98 KB, text/plain)
2011-06-05 20:51 UTC, S.Trzmiel
Testcase openvpn config (40.00 KB, application/octet-stream)
2011-06-05 21:00 UTC, S.Trzmiel

Note You need to log in before you can comment on or make changes to this bug.
Description S.Trzmiel 2011-06-04 19:33:26 UTC
Version:           0.9 (using KDE 4.6.3) 
OS:                Linux

I can't connect to the vpn using Plasma-NetworkManager from kde-unstable (nm09 branch, not the one hacked by fedora devs). Basic networking works fine, I can access system connections too. But connecting to x509+user/pass protected openvpn fails. There are some entries in /var/log/messages regarding failed connection:

Jun  4 13:48:50 xeno kernel: : [ 5209.632728] NetworkManager[1086]: <info>
Starting VPN service 'openvpn'...
Jun  4 13:48:50 xeno kernel: : [ 5209.637062] NetworkManager[1086]: <info> VPN
service 'openvpn' started (org.freedesktop.NetworkManager.openvpn), PID 22560
Jun  4 13:48:51 xeno kernel: : [ 5210.259599] NetworkManager[1086]: <info> VPN
service 'openvpn' appeared; activating connections
Jun  4 13:48:51 xeno kernel: : [ 5210.466440] NetworkManager[1086]: <info> VPN
plugin state changed: 3
Jun  4 13:48:51 xeno kernel: : [ 5210.466482] NetworkManager[1086]: <info> VPN
connection 'BlueSoft HQ' (Connect) reply received.
Jun  4 13:48:51 xeno kernel: : [ 5210.466493] NetworkManager[1086]: <warn> VPN
connection 'BlueSoft HQ' failed to connect: 'property 'user-name' invalid or
not supported'.
Jun  4 13:48:51 xeno kernel: : [ 5210.466923] NetworkManager[1086]: <warn>
error disconnecting VPN: Could not process the request because no VPN
connection was active.
Jun  4 13:48:51 xeno kernel: : [ 5210.467744] NetworkManager[1086]: <info>
Policy set 'Xenos' (wlan1) as default for IPv4 routing and DNS.
Jun  4 13:48:56 xeno kernel: : [ 5216.075113] NetworkManager[1086]: <info> VPN
service 'openvpn' disappeared
Revelant packages istalled on my system:



Reproducible: Always

Steps to Reproduce:
1. Configure openvpn connection as x.509 with password 
2. Attempt to connect to the openvpn connection.

Actual Results:  
Connection fails, quoted message appears in logs.

Expected Results:  
Connection estabilished succesfully
Comment 1 Lamarque V. Souza 2011-06-04 23:24:33 UTC
Created attachment 60632 [details]
Script to get information about the VPN connection

Can you run the attached script when connecting using Plasma NM and run it again using nm-applet (in this order)? I do not have means to test openvpn connections, so I need you to test it for me.
Comment 2 Ilia Kats 2011-06-05 18:26:21 UTC
Created attachment 60665 [details]
patch for testing

Could you try the attached patch? You probably will have to create a new connection.
Comment 3 S.Trzmiel 2011-06-05 20:46:17 UTC
Created attachment 60669 [details]
Test script output for plasma-nm

As requested plasma-nm VPN connection properites extracted with provided script.
Building plasma-nm client with patch in the meantime ...
Comment 4 S.Trzmiel 2011-06-05 20:51:40 UTC
Created attachment 60670 [details]
Script output for the same connection under gnome nm-applet

Properties of the same connection resaved in gnome nm-applet. Gnome applet refused to connect with connection created in plasma-nm, I had to reenter username end save connection once again. Then vpn worked as advertised.
Comment 5 S.Trzmiel 2011-06-05 21:00:09 UTC
Created attachment 60671 [details]
Testcase openvpn config

This one might be handy when more testing is needed. It's basic openvpn config for server and certificates for client. I run it on one physical imachine + one in virtualbox. Server located on real one and client under VirtualBox

Extract server config in /etc, client config in client home dir.
Make sure you have backup of servers /etc/openvpn and client ~/.cert dirs

client username: user
client password: pass
Comment 6 S.Trzmiel 2011-06-05 21:17:43 UTC
Tried plasma-nm client with patch provided by Ilia. I've set up a new connection and it  works ok. Thanks a lot. That was pretty fast. :)
Comment 7 Ilia Kats 2011-06-05 21:32:29 UTC
Git commit b486eb07cd96f5bb14ccfb197b40e11418f36d29 by Ilia Kats.
Committed on 05/06/2011 at 21:26.
Pushed by iliakats into branch 'nm09'.

apparently NM adds user-name to vpn data map when it's provided in vpn
settings and the openvpn plug-in can't handle this, so don't do that, we
already have a username in the data map.

BUG: 274930

M  +0    -2    vpnplugins/openvpn/openvpnwidget.cpp     

Comment 8 S.Trzmiel 2011-06-06 01:11:57 UTC
I found one problem with proposed solution. Username is not saved in settings anymore. Each time connection properities window is open username field is blank. Also it has to be reentered everytime nm client disconects daemon (reboot, suspend, service restart ...). Else connection won't work due to the failed authentication.
Comment 9 Ilia Kats 2011-07-19 03:54:29 UTC
Git commit 3582237e508ab9dc2d56a80111a7faf6e652f97a by Ilia Kats.
Committed on 19/07/2011 at 03:58.
Pushed by iliakats into branch 'nm09'.

Port all VPN-Plugins which support this to the new secrets flags system.
Add auth-dialogs for OpenVPN and PTTP.
Fix some minor bugs

BUG: 269951
BUG: 277354
CCBUG: 274930

M  +108  -76   vpnplugins/pptp/pptpwidget.cpp
M  +0    -1    vpnplugins/vpnc/vpncauth.h
M  +0    -1    kded/settingsnm08/vpnpersistence.cpp
M  +9    -0    vpnplugins/openvpn/openvpnwidget.h
M  +1    -0    vpnplugins/openvpn/openvpn.h
M  +6    -0    vpnplugins/pptp/pptp.cpp
C  +11   -12   vpnplugins/openvpn/openvpnauth.h [from: vpnplugins/vpnc/vpncauth.h - 072% similarity]     [License: GPL]
M  +2    -1    vpnplugins/pptp/CMakeLists.txt
M  +1    -49   libs/internals/settings/vpn.h
M  +2    -4    vpnplugins/vpnc/vpncwidget.h
M  +21   -39   vpnplugins/vpnc/vpncwidget.cpp
M  +20   -18   vpnplugins/vpnc/vpncauth.cpp
M  +3    -3    vpnplugins/vpnc/vpncauth.ui
M  +3    -4    libs/internals/settings/vpnsecrets.cpp
M  +177  -66   vpnplugins/openvpn/openvpnprop.ui
M  +183  -69   vpnplugins/openvpn/openvpnwidget.cpp
C  +11   -12   vpnplugins/pptp/pptpauth.h [from: vpnplugins/vpnc/vpncauth.h - 072% similarity]     [License: GPL]
M  +0    -11   libs/internals/settings/vpn.cpp
M  +4    -1    vpnplugins/pptp/pptpwidget.h
M  +76   -94   vpnplugins/pptp/pptpauth.ui
M  +3    -7    libs/ui/vpnpreferences.cpp
A  +68   -0    vpnplugins/pptp/pptpauth.cpp     [License: GPL]
M  +28   -1    vpnplugins/pptp/pptpprop.ui
A  +172  -0    vpnplugins/openvpn/openvpnauth.cpp     [License: GPL]
M  +1    -0    vpnplugins/openvpn/CMakeLists.txt
M  +9    -15   vpnplugins/vpnc/vpnc.cpp
M  +1    -0    vpnplugins/pptp/pptp.h
M  +6    -0    vpnplugins/openvpn/openvpn.cpp