5

vpnbook.com offers a free openVPN service. This is one of their files: http://paste.ubuntu.com/7231382/ with the name vpnbook-uk1-tcp80.ovpn.

I want to convert it to 3 files to be usable in network-manager-openvpn:

enter image description here

1

4 Answers 4

4

I created a script here to automate fetching password & zip files from vpn websites such as vpnbook.com, extracting the ca, cert, and key data from the ovpn files, and updating the opvn files so the certs should just import for you.

4

Copy the text between <ca> and </ca>, paste it in a text editor and save it as ca.crt. The text between <cert> and </cert> should be saved as client.crt and the text between <key> and </key> should be saved as client.key.


You must set some advanced options in accordance to the configuration file. I couldn't connect to servers using port 80, but port 443 works for me. This is what I did:

enter image description here enter image description here enter image description here

3
  • Password with Cert would be my guess.
    – Ian Hyzy
    Apr 11, 2014 at 20:03
  • @onrea answer updated. Apr 11, 2014 at 20:23
  • @Eric, Thanks, Worked charming, However, it's odd why network manager does not support .ovpn files!
    – mini
    Apr 12, 2014 at 5:09
0

since all ovpn files are all simple plain text files, you can create a python scripts with the following logic:

(1) read the contents of ovpn text file;

(2) grab relevant text between tags using regular expression;

def grabBetweenTag(tagName, fileContents):

    betweentag = re.findall('<'+tagName+'>.*\n(^.*$.*\n[\S\n]+.*$\n)</'+tagName+'>', fileContents, re.MULTILINE)

    return betweentag[0]

grabBetweenTag('ca', fileContents)
grabBetweenTag('cert', fileContents)
grabBetweenTag('key', fileContents)

(3) copy that text into a new text file;

(4) the mapping between tags and new-text-file to create looks like this:

  • All text between '<ca>' and '</ca>'will be used to create '**ca.crt';
  • All text between '<cert>' and '</cert>' will be used to create '**client.crt';
  • All text between '<key>' and '</key>' will be used to create '**client.key'.

I created this repository as an example implementation of that logic to grab all ovpn files and create certificates

*.ovpn --> *-ca.crt, *-client.crt, *-client.key

0

In Gnome you can just click the + to add VPN:

Plus

And then select OpenVPN here:

OpenVPN

Then you can open the .ovpn file.

Unfortunately it doesn't provide a way to load a new .opvn into an existing VPN config, so the easiest way if you want to change an existing VPN is to delete it and make a new one.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.