unable to import config with inlined ca, cert, key or tls-auth

Bug #606365 reported by Till Klampaeckel
766
This bug affects 164 people
Affects Status Importance Assigned to Milestone
NetworkManager-OpenVPN
Fix Released
Medium
plasma-nm
Fix Released
High
network-manager-openvpn (Ubuntu)
Fix Released
Medium
Unassigned
plasma-nm (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

Binary package hint: network-manager-openvpn-gnome

So a client of mine runs an OpenVPN setup. It exported a client.ovpn file but it fails to completely import this file using the network-manager (gnome) on Ubuntu 10.04.

When I import the file, it gives me the name ("client") and gateway ("vpn.example.org") on the initial screen. No other fields are populated even though the client.ovpn file also includes a user certificate, server certifikate and a private key.

When I go to advanced, some (most) of the settings obviously seem to import correct, others not at all. E.g. none of the TLS settings (key and key direction) are imported.

From what I understand I should be able to use this without any additional settings.

The following software is installed through aptitude:

 * openvpn (2.1.0)
 * openvpn-blacklist
 * network-manager-openvpn
 * network-manager-openvpn-gnome

Tags: xenial
Revision history for this message
Till Klampaeckel (till-php) wrote :

I wanted to share the configuration (dummy):

remote vpn.example.org
client
proto tcp
port 443
dev tun
ns-cert-type server
auth-user-pass
auth-retry interact
comp-lzo
verb 3

<ca>
-----BEGIN CERTIFICATE-----
FOO
-----END CERTIFICATE-----
</ca>

<cert>
-----BEGIN CERTIFICATE-----
FOO
-----END CERTIFICATE-----
</cert>

<key>
-----BEGIN RSA PRIVATE KEY-----
FOO
-----END RSA PRIVATE KEY-----
</key>

key-direction 1
<tls-auth>
#
# 2048 bit OpenVPN static key (Server Agent)
#
-----BEGIN OpenVPN Static key V1-----
FOO
-----END OpenVPN Static key V1-----
</tls-auth>

So the quickfix here is that you can dissect the file and import it all once you figured out the corresponding dropdown/whatever in the network manager. So for example in the example above I needed to select "Passwords with certificates (TLS)" and enter another user/pass along with it, no password for the key and also the TLS key and direction in advanced.

One more note - the following settings seemed to get imported:
proto, port, comp-lzo, remote

The rest was ignored.

I hope this helps.

Revision history for this message
emilio (emiliomaggio) wrote :

I have the same problem in importing the ovpn file provided by my company system administrators

emilio (emiliomaggio)
Changed in network-manager-openvpn (Ubuntu):
status: New → Confirmed
Revision history for this message
AlexConrad (aconrad-tlv) wrote :

Same problem for me under Ubuntu 10.04.

Running "sudo openvpn --config client.ovpn" works though.

Revision history for this message
Mitch Goldenberg (kgolden) wrote :

Same problem in Ubuntu 10.10.

Again, "sudo openvpn --config client.ovpn" works properly.

Revision history for this message
Till Klampaeckel (till-php) wrote :

Thanks for posting the workaround, it's definitively a small bug in network-manager-openvpn.

Revision history for this message
kapetr (kapetr) wrote :

I can confirm that in Ubuntu 10.10:

Specially: statements auth-user-pass and route are ignored.

So most config are not possible to import.
To set auth-user-pass manually in applet is trivial, but add e.g. 20 route statements via this interface is quite impossible.

See for example attached config for popular USA IP service with man routes.

BTW - in this example - OpenVPN do not addd route to host (--remote) via the old GW. I'm not sure, if it is not also a bug, but the config fails. It is necessary to add also this route statement:

route remote_host net_gateway

--kapetr

Revision history for this message
kapetr (kapetr) wrote :
Revision history for this message
Till Klampaeckel (till-php) wrote :

To add to this - the export feature is broken too.

I tried to rescue a couple profiles which I had done on another workstation for backup purposes, but it didn't work at all in 10.04.1.

Revision history for this message
lordbinky (lordbink) wrote :

I have the same issue in Ubuntu 11.04 where importing a .ovpn file isn't completely imported.

Revision history for this message
Justin (justin-wzy) wrote :

same issue in Oneiric

Revision history for this message
Stephan Fabel (sfabel) wrote :

This problem still exists in Precise.

Revision history for this message
Todd Howe (tehowe) wrote :

Can't hook up to my ISP's VPN. IT'S 2012

Revision history for this message
Todd Howe (tehowe) wrote :

Found a way to do this that works under GUI network-manager

http://howto.praqma.net/ubuntu/vpn/openvpn-access-server-client-on-ubuntu

Revision history for this message
lenzai (lenzai) wrote :

paqma.net website is down but the work around i still published at
http://askubuntu.com/questions/134918/setting-vpn-client

almost 2 years .... maybe we should write a bash to break down the ovpn into certificate files if this bug can't be fixed ?

Revision history for this message
exactt (giesbert) wrote :

2013... Ubuntu 12.10... still not working...

Revision history for this message
Claus Lensbøl (cmol) wrote :

Used the workaround from #14 and got it working, but without the fix I'm having the same issues.

Revision history for this message
kingtiger01 (mnovick1988) wrote :

Come on, were Weeks away from Raring(13.04) Quit Dropping the ball on things like this Ubuntu Team!

Revision history for this message
Parasit (parasit-go2) wrote :

2013... Ubuntu 13.04... still not working...
Eg. certs configuration are imported (#14 method) but still not connecting from GUI.

Revision history for this message
bagl0312 (bagl0312) wrote :

I confirm the same problem.
ovpn conf files produced by the openvpn/privatetunnel site:

https://www.privatetunnel.com/

are not imported correctly by the network-manager on ubuntu 13.04.
They instead work giving the command

openvpn --config xxx.ovpn

Revision history for this message
Carla Sella (carla-sella) wrote :

I am having the same problem importing a file for Watchguard on Saucy with all updates using network manager (today is July 20th 2013).
The "sudo openvpn --config client.ovpn" works properly.

Revision history for this message
Jakob (johnthedon) wrote :

same problem, ubuntu 13.10 here

Revision history for this message
bagl0312 (bagl0312) wrote :

Confirmed, same problem in 13.10
This bug is around since more than two years now :(

Revision history for this message
Bachi (m-bachmann) wrote :

Proud to be the first posting 2014. Wow. C'mon folks...

Revision history for this message
Giovanni Panozzo (giox069) wrote :

This is the more related upstream bug:

https://bugzilla.gnome.org/show_bug.cgi?id=633337

Please add your comments there explaining all problems importing .ovpn files (certs not imported, invalid TLS selection and other badly imported parameters).
Maybe someone will notice it one day... :(

Revision history for this message
Monty Cantsin (open-pop-star) wrote :

same in Trusy Tahr 14.04

Revision history for this message
Martin (getmartin) wrote :

Confirmed, same bug in 14.04.
Well, the workaround "sudo openvpn --config client.ovpn" is still working.

Revision history for this message
Carlos Tavares Jr (carlosmtavaresjr) wrote :

I am having issues with 14.04 lts openvpn client for gnome as well. I get the same freezing and not loading the config file issues. I had to revert back to 12.04 lts as this feature is needed in my line of work. Any fix available?

Simon Déziel (sdeziel)
summary: - client.ovpn file is not completely imported
+ unable to import config with inlined ca, cert, key or tls-auth
Changed in network-manager-openvpn:
importance: Undecided → Unknown
status: New → Unknown
Changed in network-manager-openvpn:
importance: Unknown → Medium
status: Unknown → Confirmed
Revision history for this message
Tomislav (hefest) wrote :

Same as #25 and #26.

Revision history for this message
Tomislav (hefest) wrote :

Actually, I'm not having luck with the workaround: it seems that DNS settings have not been updated to find recources in the VPN.

Revision history for this message
Solitaire (bill-s0l) wrote :

This bug affects me as well.

Anyone got a script working to automate the creation of the separate certificates and keys from inside the .ovpm file?
Would be a great workaround till this gets fixed

Revision history for this message
Frol (frolvlad) wrote :

2015... Nothing was done yet. Let's make some movements.

Here is the import function:
http://bazaar.launchpad.net/~network-manager/network-manager-openvpn/trunk/view/head:/properties/import-export.c#L268

and here are the lines of ca/cert/key tags parsing:
http://bazaar.launchpad.net/~network-manager/network-manager-openvpn/trunk/view/head:/properties/import-export.c#L563

My suggestion is to save inline ca/cert/key inside of a Network Manager configurations file encoded into base64 (again) with "inline:" prefix, e.g.:
[connection]
id=MyVPN
uuid=ac9d354e-03ef-4063-8c96-4a40bd17bea6
type=vpn

[vpn]
service-type=org.freedesktop.NetworkManager.openvpn
connection-type=tls
remote=myvpnhost.com
cert-pass-flags=0
tap-dev=no
proto-tcp=no
mssfix=no
ca=inline:<base64 coded>
cert=inline:<base64 coded>
key=inline:<base64 coded>

Another approach would be to parse as much information from *.ovpn file as we can, remove parsed parts, encode rest of the file into a base64 string, and save it into a Network Manager connection config file. This may help to deal with extra options like inline certificates, but may also cause unexpected configuration conflicts.

Revision history for this message
Ryan Hendry (ryanhendry123) wrote :

I am experiencing the same problem.

Revision history for this message
Mahdi Fattahi (mfat) wrote :

Can somebody please fix this?

Revision history for this message
Lars (stecklars-r) wrote :

Would be really nice if somebody could take a look at this and work on it. Thanks :)

Revision history for this message
seebk (seebk) wrote :

I have created a small python script to extract the embedded certificates and to rewrite the ovpn config to use separate key and cert files.

https://gist.github.com/seebk/bb94a7fd70d4cc454aaa

Maybe it helps to simplify the error prone manual setup until this bug is fixed.

60 comments hidden view all 114 comments
Revision history for this message
In , Psychonaut (psychonaut) wrote :

The Connection Editor of the NetworkManager plasma applet is unable to import OpenVPN configuration files which contain inline certificates and keys.

Reproducible: Always

Steps to Reproduce:
1. Open the Connection Editor.
2. File -> Import VPN…
3. Select and open an OpenVPN configuration file (.ovpn) which contains inline certificates and/or keys. That is, the file specifies "[inline]" as the value of the ca, cert, key, and/or tls-auth fields, and then provides ASCII-armoured certificates and/or keys in <ca>, <cert>, <key>, and <tls-auth> elements at the end of the file.

Actual Results:
4. For every inline certificate/key in the configuration file, an error dialog appears indicating that the certificate/key could not be copied because the file [inline] could not be opened. For example:

Error copying file to /home/miller/.kde4/share/apps/networkmanagement/certificates/ukp-vpn_[inline]: Cannot open /tmp/[inline] for input

Expected Results:
4. The Connection Editor should recognize that "[inline]" is not a filename but rather a special value indicating that the certificate/key is contained within the OpenVPN configuration file itself. It should then read in and process that certificate/key.

Revision history for this message
In , Jgrulich (jgrulich) wrote :

Do you really use plasma-nm in version 0.9.3.4? I thought this has been fixed already. Any chance you can try at least 0.9.3.5 version where I did one more fix regarding OpenVPN import.

Revision history for this message
In , Psychonaut (psychonaut) wrote :

Yes, I'm running plasma-nm 0.9.3.4. I can't test 0.9.3.5 at the moment but can do so as soon as it's packaged for openSUSE 13.2.

Revision history for this message
In , Lamarque (lamarque) wrote :

That is not the syntax our import code expects. The import code expects no ca, cert, key or ts-auth tags with '[inline]' as value when certificates are embedded. It expects only <ca>, <cert> <key> and <tls-auth> tags in that case. Besides, using '[inline]' as value is redundant in this case.

Revision history for this message
In , Psychonaut (psychonaut) wrote :

It may not be the syntax the plasma-nm import code expects, but it's one that the OpenVPN command-line client supports. I've come across a few .ovpn files which use this syntax, and I've seen it recommended by OpenVPN experts such as Jan Just Keijser (see for example <http://openvpn-users.narkive.com/ZwzahkCv/embedding-key-cert-ca-into-client-config>).

It looks like this [inline] directive was never documented in the OpenVPN man pages. However, given that it's in use, it might still be a good idea for plasma-nm to handle this syntax.

Revision history for this message
In , Lamarque (lamarque) wrote :

Git commit 599afdacd744a2d7785274687438a23f21617c34 by Lamarque V. Souza.
Committed on 28/06/2015 at 23:26.
Pushed by lvsouza into branch 'master'.

Add support to import .ovpn files with syntax described in
http://openvpn-users.narkive.com/ZwzahkCv/embedding-key-cert-ca-into-client-config
FIXED-IN: 0.9.3.7

M +22 -5 vpn/openvpn/openvpn.cpp

http://commits.kde.org/plasma-nm/599afdacd744a2d7785274687438a23f21617c34

Revision history for this message
In , Lamarque (lamarque) wrote :

Git commit c6f0b9df0e1a78c4d54058136580104b5e5b22a7 by Lamarque V. Souza.
Committed on 29/06/2015 at 00:21.
Pushed by lvsouza into branch '0.9.3'.

Add support to import .ovpn files with syntax described in
http://openvpn-users.narkive.com/ZwzahkCv/embedding-key-cert-ca-into-client-config
FIXED-IN: 0.9.3.7

M +22 -5 vpn/openvpn/openvpn.cpp

http://commits.kde.org/plasma-nm/c6f0b9df0e1a78c4d54058136580104b5e5b22a7

65 comments hidden view all 114 comments
Revision history for this message
zao (zao-d) wrote :

Hope this bug will be addressed - five years without a fix - is far too long...
:(

Revision history for this message
Nyr (nyr7) wrote :

Come on, many of the latest OpenVPN implementations use in-line certificates by default... how can this bug be still there five years later?

Revision history for this message
reliable-robin-22 (nicolasdiogo) wrote :

Happy Birthday to this Bug !!!

Sarcasm apart - it is amazing that such an important piece of software is not been supported properly - particularly with the corporate market requesting it.

if the suggestion here:
https://bugzilla.gnome.org/show_bug.cgi?id=633337

is correct - that it is not possible to handle inline certificates & it will be necessary to manually edit the ovpn file.

could we have an article/wiki explaining the steps to do so?

or a small utility that could do this work?

Thanks,

Revision history for this message
reliable-robin-22 (nicolasdiogo) wrote :
Revision history for this message
Frol (frolvlad) wrote :

@Nicolas It is not the answer for *inlined* certificates. You can extract inline certificates into separate files, but it is not what people requested here.

Changed in network-manager-openvpn:
status: Confirmed → Fix Released
Mathew Hodson (mhodson)
Changed in network-manager-openvpn (Ubuntu):
importance: Undecided → Medium
importance: Medium → High
34 comments hidden view all 114 comments
Revision history for this message
Simon Déziel (sdeziel) wrote :

@datsi, I noticed that the importer has trouble with "comp-lzo something". Using "comp-lzo" alone worked for me but I didn't test with inline cert nor PKCS12.

Revision history for this message
Simon Déziel (sdeziel) wrote :

I just tested with inlined ca, cert, key and tls-auth on Ubuntu Xenial. All of them are properly imported, the only problem is how to specify the tls-auth key direction if any.

With inlined style, <tls-auth> requires specifying the key direction with the "key-direction" parameter. The problem is the importer just ignores the "key-direction" parameter.

Revision history for this message
Micah Mangione (randomlogic314) wrote :

For what it's worth, an out-of-the-box OpenVPN 2.1.3 Access Server user-locked configuration file only needs 1 parameter changed to import with the "network-manager-openvpn-gnome" tool.

The line that says:
reneg-sec 604800

Comment that out.
# reneg-sec 604800

Imports without issue now.

1 comments hidden view all 114 comments
Revision history for this message
Sodki (henrique-rodrigues) wrote :

With Ubuntu 16.04, solution provided by #77 worked. Thanks, Micah.

Revision history for this message
Patrick (patrick-w) wrote :

Holy cow! Micah you cracked it for me too! Finally after all these years I can use OpenVPN without cli. Kudos to you.

Revision history for this message
Samuel Ausman (sgausman) wrote :

Can also confirm that solution specified in comment #77 worked for me on Ubuntu 16.04.1. Thank you Micah!

Revision history for this message
Peter Passchier (peter-passchier) wrote :

I've found that removing the #comments in the TA key helped.

Revision history for this message
D (360-dennis) wrote :

I'm sorry, but im a newbie, but how does this fix get into the ubuntu versions? Do we have to wait until network-manager-openvpn (Ubuntu) gets assigned?

Revision history for this message
Jeremy LaCroix (j-jlacroix) wrote :

This is working for me now. When I import into Network Manager, it literally tells me which line is the problem now, and whatever line that is, I comment it out and it works. Before, it would just tell me that there was an issue importing but it wasn't specific. But at least now, Network Manager helps me figure out the issue. I recently switched to Ubuntu GNOME, so I'm not sure if there's something specific with the GNOME implementation that displays specific errors, or if Network Manager has changed. At least it's working for me now, albeit with manual intervention being required.

In my opinion, the real issue at this point is that even though commenting out some lines helps, each line is valid and should be accepted. If I export an .ovpn file and use it via the command line, it works without issue (even without commenting out anything). In my view, if the config file is valid enough for OpenVPN itself, it should surely be valid for Network Manager. Perhaps the OpenVPN spec has updated and Network Manager hasn't been updated to match?

Revision history for this message
BloodyIron (bloodyiron) wrote :

I'm on ubuntu 16.10,

I have pfsense running my openVPN service, and I exported the client config to an ovpn file (inline).

When I get network-manager to import, I STILL get "the plugin does not support import capability".

This bug has been open for OVER 6 YEARS now. How about we get this conclusively fixed already??? I have to switch to Windows to VPN in, I can't get network-manager to use any of my VPN info, even if I manually enter it.

It's mind-blowing this still exists as a problem.

Revision history for this message
Martin Zbořil (buntubugzilla) wrote :

funnily enough, the bug is actually fixed, all what is needed is actually network-manager-openvpn-gnome (I tested it on version 1.1.93-1ubuntu1.1 in 16.04.2) installed and then the network settings configuration gui restarted so the new VPN shows up as openvpn, after that importing the configuration from ovpn file works..

Revision history for this message
D (360-dennis) wrote :

im on 16.04.2 too, but i still see the bug. the workaround #77 didnt help for me too..

Revision history for this message
BloodyIron (bloodyiron) wrote :

I was able to import my config after making the adjustment outlined here : https://askubuntu.com/a/816140

However now I am having issues with systemd and my tap device, I'm not sure it's correctly creating it as I'm doing bridging not tunneling on the server end :( (probably unrelated here though)

Also, please note that the above method for the import did not correctly import my key direction, I had to change that after importing, which is weird.

Revision history for this message
James D. Hasselman (james.d.hasselman) wrote :

The error I get is:

"The file 'file.ovpn' could not be read or does not contain recognized VPN connection information

Error: Key file contains line 'dev tun' which is not a key-value pair, group, or comment."

If I edit the file and remove the line "comp-lzo adaptive" from the end of the file the import is successful.

Mathew Hodson (mhodson)
tags: added: xenial
removed: network-manager openvpn
Mathew Hodson (mhodson)
affects: network-manager-openvpn (Fedora) → plasma-nm
Changed in plasma-nm:
importance: Undecided → Unknown
status: New → Unknown
Revision history for this message
Robie Basak (racb) wrote :

The original bug as reported was a failure to import certain configuration files using network-mangaer-openvpn. This turned out to be due to the use of inlined key material (comment 24). network-manager-openvpn did not support this as a feature at the time, so was unable to parse this type of configuration file.

Support was since added (comment 46). This has been confirmed to work (comments 49, 63, 67, 68 etc). Therefore, this bug as reported has been fixed, so I'm setting it to Fix Released.

It may well be that this doesn't solve configuration imports for all users, as is clear from subsequent comments. But we track one issue per bug, since otherwise statements like "this bug is fixed" and "this bug is not fixed" become meaningless, developers cannot track what they are being asked to do, and users end up with wildly varying expectations that can never be met.

Note that a failure to import a configuration can be an entire class of bugs, not just one single bug. This bug's original reporter's problem turned out to be "doesn't work with inlined key material". Clearly that's not the only thing wrong here, as adding inlined key material support solved the problem for some, but not others. Of the remaining users here who still have import problems, there may yet be *multiple* underlying bugs. So please don't all pile on to a different bug thinking you're still all affected by the same issue.

If you'd like to see your problem fixed, and you'd like to help, then first please read "How to Report Bugs Effectively" (https://www.chiark.greenend.org.uk/~sgtatham/bugs.html) carefully. Take some time to work out exact steps to reproduce your problem, make sure that they really do reproduce, and then paste exact and detailed instructions on how to reproduce your problem into a new bug report. Don't assume that someone else's import failure problem is due to the same underlying bug as your import failure problem. Do link to bugs that you think may be related (such as this one). Don't worry about filing duplicates; in this kind of case it takes far more effort to untangle reports that turn out to have different root causes then it does to mark duplicate bugs if this becomes clear to developers later.

I hope this helps. I can't guarantee what will come next, but by filing actionable reports at least you'll be one step closer to real progress.

Changed in network-manager-openvpn (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Mathew Hodson (mhodson) wrote :

network-manager-openvpn was fixed in Xenial with https://launchpad.net/ubuntu/+source/network-manager-openvpn/1.1.93-1

Revision history for this message
Mathew Hodson (mhodson) wrote :
Changed in plasma-nm (Ubuntu):
importance: Undecided → Medium
Changed in network-manager-openvpn (Ubuntu):
importance: High → Medium
Changed in plasma-nm (Ubuntu):
status: New → Fix Released
10 comments hidden view all 114 comments
Revision history for this message
In , Psychonaut (psychonaut) wrote :

Still reproducible for me with plsma-nm 5.10.4. I get the following error dialog when importing configuration files with inline certificates and agreeing with the prompt to copy the certificates to ~/.local:

Error copying certificate to /home/psy/.local/share/networkmanagement/certificates/ukp-vpn_[inline]: Cannot open /home/psy/vpn/UKP/[inline] for input

Revision history for this message
In , Psychonaut (psychonaut) wrote :

I should add that despite the error message, plasma-nm successfully extracted the certificates and copied them to ~.local/share/networkmanagement/certificates. So maybe the error message is spurious.

Revision history for this message
In , Lamarque (lamarque) wrote :

Hi. Hmmm QFile was not able to open the source file (/home/psy/vpn/UKP/[inline]). Does your user has permission to open that file for reading? That error message is shown only if QFile::copy returns false [1]

If the destination file already exists then QFile::copy returns false. That can be the problem too. In that case QFile::copy does not override the destination file. Probably we should ask the user if he/she wants to override it or keep the old one.

[1] http://doc.qt.io/qt-5/qfile.html#copy

OBS: since Plasma NM was not able to copy the file what it does is registering the source file's path (/home/psy/vpn/UKP/[inline]) in NetworkManager. Since NetworkManager run as root it probably has permission to read that file.

OBS2: Plasma NM run as normal user.

Revision history for this message
In , Psychonaut (psychonaut) wrote :

(In reply to Lamarque V. Souza from comment #9)
> Hi. Hmmm QFile was not able to open the source file
> (/home/psy/vpn/UKP/[inline]). Does your user has permission to open that
> file for reading? That error message is shown only if QFile::copy returns
> false [1]

That's because the file doesn't exist. As I already mentioned in the original report, plasma-nm is misinterpreting the [infile] header in the .ovpn file as a filename. It should not be trying to open any new files; the certificates should be read from the .ovpn file it already has open.

Revision history for this message
In , Lamarque (lamarque) wrote :

Does your file name has any space in it? If it does then you must use quotation mark in the .ovpn to delimitate the file name.

Revision history for this message
In , Psychonaut (psychonaut) wrote :

(In reply to Lamarque V. Souza from comment #11)
> Does your file name has any space in it? If it does then you must use
> quotation mark in the .ovpn to delimitate the file name.

I'm telling you for the third time, there is no filename in the .ovpn file. This bug report is about plasma-nm's failure to process .ovpn files which use the special identifier "[inline]" to indicate that the certificates and/or keys are included directly in the .ovpn file.

Changed in plasma-nm:
importance: Unknown → High
status: Unknown → New
14 comments hidden view all 114 comments
Revision history for this message
Andreas (andreas-8) wrote :

Just experienced this issue in Ubuntu 17.04. Manually configuring the key-direction as stated in #76 fixed it.

Revision history for this message
Mustafa (finchie) wrote :

My ubuntu 16.04 has affected but #77 fixed it.

Revision history for this message
Feraali Sanger (amp-gold) wrote :

I was able to solve my problems on Ubuntu Mate 18.04 by using the command line (rather than the network manager gui) to import the .ovpn as follows:

User@Node-99:~/Downloads$ sudo nmcli connection import type openvpn file Miami.ovpn

Error: failed to import 'Miami.ovpn': configuration error: invalid 1th argument to “mssfix” where number expected (line 6).

What is good about the command line is that it is more verbose and will help you find which line in your .ovpn file is causing the error.

In my case I used a text editor to open the file Miami.ovpn and I commented out the offending line (It was line 6)

So I placed a # in front of the line and a space.

After doing that:

User@Node-99:~/Downloads$ sudo nmcli connection import type openvpn file Miami.ovpn
Connection 'Miami' (cb4d9379-9f35-4b03-b53d-3af05781e5aa) successfully added.

Problem solved. VPN able to connect now and it shows up as a choice inside of the Network manager.

13 comments hidden view all 114 comments
Revision history for this message
In , Psychonaut (psychonaut) wrote :

Still reproducible as discussed in Comment 7 and Comment 8 with plasma-nm 5.12.6. That is, importing an OpenVPN configuration file with inline certificates and keys throws up a spurious error dialog about being unable to open the nonexistent file named "[inline]". However, the certificates and keys get successfully copied anyway.

Revision history for this message
In , Dennis Schridde (devurandom) wrote :

Does the import work when using nmcli (`nmcli connection import type openvpn file $FILENAME`)?

If nmcli works, I would think this is mostly caused by Plasma NM not using the NetworkManager OpenVPN code to import configuration files (bug #396530), but implements an own buggy version.

Revision history for this message
In , Psychonaut (psychonaut) wrote :

(In reply to Dennis Schridde from comment #14)
> Does the import work when using nmcli (`nmcli connection import type openvpn
> file $FILENAME`)?
>
> If nmcli works, I would think this is mostly caused by Plasma NM not using
> the NetworkManager OpenVPN code to import configuration files (bug #396530),
> but implements an own buggy version.

I'm now using plasma-nm 5.12.8. This version has the same behaviour as described for plasma-nm 5.12.6 in Comment 13: attempting to import an .ovpn file with inline certificates and keys results in a spurious error dialog, but the keys and certificates get successfully copied anyway.

I also tried using nmcli. This seems to work without any problems:

$ nmcli connection import type openvpn file ~/vpn/ukp-vpn.ovpn
Connection 'ukp-vpn' (c6cbabfe-f117-4af9-aca5-be9e8c88595c) successfully added.

When I open the NetworkManager plasma applet after doing this, I see the VPN connection listed there, with the keys and certificates copied into separate files under ~/.cert/nm-openvpn.

Revision history for this message
Kerstin Maur (kerstinmaur) wrote :

I am having the same issue on Ubuntu 18.04 LTS.

sudo nmcli connection import type openvpn file config.ovpn
gives the following error
Error: failed to import 'config.ovpn': configuration error: unsupported 3th argument net_gateway to “route” (line 12).

Running
sudo openvpn config.ovpn
works

Revision history for this message
ThomasG (thomas-gratier) wrote :

Made a script to split a single OpenVPN file to multiple to avoid the issue due to XML chunks within the single file breaking network-manager-openvpn when importing
https://gist.github.com/ThomasG77/5c09eead1244f9d1d2bd7fa70b26fead

Revision history for this message
In , Nicolas-fella (nicolas-fella) wrote :

In Plasma 5.27 we changed the VPN import to match what nmcli is doing, so this should be fixed

See https://invent.kde.org/plasma/plasma-nm/-/commit/9b22aa548f02ef43f7275ab2f9ffa48bde8a1ba8

Changed in plasma-nm:
status: New → Fix Released
Displaying first 40 and last 40 comments. View all 114 comments or add a comment.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related questions

Remote bug watches

Bug watches keep track of this bug in other bug trackers.