After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 759811 - Not working with static key and tcp
Not working with static key and tcp
Status: RESOLVED FIXED
Product: NetworkManager
Classification: Platform
Component: VPN: openvpn
unspecified
Other Linux
: Normal normal
: ---
Assigned To: NetworkManager maintainer(s)
NetworkManager maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2015-12-23 16:15 UTC by misc
Modified: 2016-01-11 13:01 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Use tcp-client instead of tcp (1.42 KB, patch)
2015-12-23 16:15 UTC, misc
none Details | Review

Description misc 2015-12-23 16:15:45 UTC
Created attachment 317818 [details] [review]
Use tcp-client instead of tcp

This bug is a copy of https://bugzilla.redhat.com/show_bug.cgi?id=1288711

On RHEL 7.2, I found that using a static key and the openvpn plugin do not work. The nm openvpn plugin generate a incorrect command line to start openvpn.

Since some unscpecified version, openvpn requires to have --proto tcp-client or --proto tcp-server when using a static key. And the plugin just give --proto tcp as argument.

I found the code adding it:
https://git.gnome.org/browse/network-manager-openvpn/tree/src/nm-openvpn-service.c#n1038

And propose the attached patch to fix that.

(it is for now untested)
Comment 1 Federico Bruni 2015-12-26 10:01:16 UTC
I confirm this problem on version 1.0.6 on Fedora23.

This is the error which shows up on `journalctl -n`:

Options error: --proto tcp is ambiguous in this context.  Please specify --proto tcp-server or --proto tcp-client

The openvpn configuration file (foo.conf), imported in NetworkManager, doesn't work, while it works correctly if I copy foo.conf to /etc/openvpn and run:

systemctl start openvpn@foo.service
Comment 2 misc 2016-01-09 15:42:25 UTC
I finally was motivated to test the patch in real life (ie, with a annoying firewallà), and it worked fine.
Comment 3 Thomas Haller 2016-01-11 13:01:10 UTC
Note that the openvpn manual states:
  --remote host [port] [proto]

  proto indicates the protocol to use when connecting with the remote, and may 
  be "tcp" or "udp".

So, this sets an undocumented option.



It only affects static-key, because all other modes set --client (which implies proto=tcp-client: https://github.com/OpenVPN/openvpn/blob/36f3a479a7d5ab01c30e8ca1a99bd2430b30893f/src/openvpn/options.c#L2364 )



Patch applied:

master: https://git.gnome.org/browse/network-manager-openvpn/commit/?id=03ad88a8678f2204784ba38dfe60c6f8410a9ffe

nm-1-0: https://git.gnome.org/browse/network-manager-openvpn/commit/?id=90489e9dc5851b3546e6f2579dad42ab3d86096a


Thanks Michael.