GNOME Bugzilla – Bug 749050
--reneg-sec breaks non-TLS modes
Last modified: 2015-05-28 09:05:49 UTC
Since 1.0.2, --reneg-sec is always added, but OpenVPN will not accept this argument when neither --tls-server nor --tls-client is set.
FYI - here's the log messages I'm seeing that demonstrate this issue: May 06 21:56:08 daroseneo NetworkManager[484]: <info> Starting VPN service 'openvpn'... May 06 21:56:08 daroseneo NetworkManager[484]: <info> VPN service 'openvpn' started (org.freedesktop.NetworkManager.openvpn), PID 2079 May 06 21:56:08 daroseneo NetworkManager[484]: <info> VPN service 'openvpn' appeared; activating connections May 06 21:56:08 daroseneo NetworkManager[484]: <info> VPN plugin state changed: starting (3) May 06 21:56:08 daroseneo nm-openvpn[2084]: Options error: Parameter renegotiate_seconds can only be specified in TLS-mode, i.e. where --tls-server or --tls-client is also specified. May 06 21:56:08 daroseneo nm-openvpn[2084]: Use --help for more information. May 06 21:56:08 daroseneo NetworkManager[484]: nm-openvpn-Message: openvpn started with pid 2084 May 06 21:56:08 daroseneo NetworkManager[484]: (nm-openvpn-service:2079): nm-openvpn-WARNING **: openvpn exited with error code 1 May 06 21:56:08 daroseneo NetworkManager[484]: <info> VPN connection 'darsys' (ConnectInteractive) reply received. May 06 21:56:08 daroseneo NetworkManager[484]: <warn> VPN plugin failed: connect-failed (1) May 06 21:56:08 daroseneo NetworkManager[484]: <info> VPN plugin state changed: stopped (6) May 06 21:56:08 daroseneo NetworkManager[484]: <info> VPN plugin state change reason: unknown (0) May 06 21:56:08 daroseneo NetworkManager[484]: <warn> error disconnecting VPN: Could not process the request because no VPN connection was active.
Created attachment 304055 [details] [review] service: only set reneg-sec option in TLS mode https://bugzilla.gnome.org/show_bug.cgi?id=749050 https://bugzilla.redhat.com/show_bug.cgi?id=1225218
Patch LGTM.
Review of attachment 304055 [details] [review]: ::: src/nm-openvpn-service.c @@ +1105,3 @@ /* Reneg seconds */ tmp = nm_setting_vpn_get_data_item (s_vpn, NM_OPENVPN_KEY_RENEG_SECONDS); + if (strcmp (connection_type, NM_OPENVPN_CONTYPE_TLS) != 0) { You need to include CONTYPE_PASSWORD_TLS too. Otherwise LGTM
I think --reneg-sec should be used for NM_OPENVPN_CONTYPE_TLS, NM_OPENVPN_CONTYPE_PASSWORD, NM_OPENVPN_CONTYPE_PASSWORD_TLS, bacause all three uses '--client'. We should just leave '--reneg-sec' out for the Static-Key mode.
Fixed also for other connection-types. Applied as https://git.gnome.org/browse/network-manager-openvpn/commit/?id=7f9031dbaee3059ea072fb2497563aee6acf8da0
and nm-1-0 branch: https://git.gnome.org/browse/network-manager-openvpn/commit/?id=0fd197dc4221708dd37ee256952e8d080356676e