GNOME Bugzilla – Bug 760746
Import openvpn config
Last modified: 2016-01-20 09:57:33 UTC
Hello, I'm on Arch Linux, Gnome 3, stable channel. step to reproduce bug: download some .ovpn file from http://www.vpngate.net/en/ and add it by network part of Gnome. Expected result (like in KDE) - everything is imported, all keys/certificates, credential to login, etc. and we need only to click 'connect'. In Gnome it imports some basic information from file, but in example no certificates - we need to cut them manually from .ovpn file to some other files and add them manually in gnome vpn network options part.
Are you using nm-connection-editor? If so, what version of NetworkManager-openvpn gnome plugin do you have? Importing inline certificates is supported by the plugin since 1.0.8; however the plugin fails with configuration file from http://www.vpngate.net/en/ since it's quite picky about the file syntax. In particular, the plugin should be modified to deal with the following: - CRLF line terminators - new line between "-----END CERTIFICATE-----" and tag end - "BEGIN RSA PRIVATE KEY" instead of "BEGIN PRIVATE KEY" I'll post a patch.
Pushed branch bg/inline-cert-fixes-bgo760746.
(In reply to Beniamino Galvani from comment #2) > Pushed branch bg/inline-cert-fixes-bgo760746. This removes empty lines ~before~ do_import() without having any context about what these lines mean. Note that do_import already skips empty lines, only handle_blob_item() does not. Better handle the parsing exception closer to handle_blob_item() where you have the context about what a particular line means. For the same reason, I'd move if (!g_utf8_validate (contents, -1, NULL)) ... lines = g_strsplit_set (contents, "\r\n", 0); inside do_import() and pass the entire blob to do_import(). Understanding line-breaks (and splitting lines) should be done by the parsing code in one place. patch 2 lgtm.
(In reply to Thomas Haller from comment #3) > (In reply to Beniamino Galvani from comment #2) > > Pushed branch bg/inline-cert-fixes-bgo760746. > > This removes empty lines ~before~ do_import() without having any context > about what these lines mean. Note that do_import already skips empty lines, > only handle_blob_item() does not. Better handle the parsing exception closer > to handle_blob_item() where you have the context about what a particular > line means. Fair enough, changed. > For the same reason, I'd move > > if (!g_utf8_validate (contents, -1, NULL)) > ... > lines = g_strsplit_set (contents, "\r\n", 0); > > inside do_import() and pass the entire blob to do_import(). Understanding > line-breaks (and splitting lines) should be done by the parsing code in one > place. Are you suggesting only to move those lines in do_import(), keeping the parsing as it is now, without real understanding of different line endings (because it just splits at \r and \n so in case of \r\n an empty line is created)? Or to add specific understanding of different terminators? Repushed branch using the first approach.
v2 looks exactly how I thought it should be. lgtm.
Merged to master: https://git.gnome.org/browse/network-manager-openvpn/commit/?id=f91c4807c283d9e5e15dd9e88142e3b33e2e9e95 and nm-1-0: https://git.gnome.org/browse/network-manager-openvpn/commit/?h=nm-1-0&id=dab12e274aa5cf995b45139f462c6cc05bb6dce3