Skip to content

Instantly share code, notes, and snippets.

@Morley93
Last active July 1, 2023 03:26
Show Gist options
  • Star 35 You must be signed in to star a gist
  • Fork 9 You must be signed in to fork a gist
  • Save Morley93/9697578 to your computer and use it in GitHub Desktop.
Save Morley93/9697578 to your computer and use it in GitHub Desktop.
This is how you can take an openvpn .ovpn config file and extract the certificates/key required to import the profile into NetworkManager.

OpenVPN .ovpn manipulation.

This is how you can take an OpenVPN .ovpn config file and extract the certificates/keys required to import the profile into NetworkManager.

  • Download the .ovpn file. Save it somewhere you can store it permanently (I use ~/.vpn).
  • Copy from between <ca> tags into ca.crt, remove <ca> tags.
  • Copy from between <cert> tags into client.crt, remove <cert> tags.
  • Copy from between <key> tags into client.key, remove <key> tags.
  • Copy from between <tls-auth> tags into ta.key, remove <tls-auth> tags.
  • Remove the line "key-direction 1"
  • Above "# -----BEGIN RSA SIGNATURE-----" insert the following lines.
    • ca ca.crt
    • cert client.crt
    • key client.key
    • tls-auth ta.key 1
  • Import the .ovpn file into NetworkManager and save the profile.
@labbots
Copy link

labbots commented May 6, 2020

I have written a bash script that could split or merge OVPN config file. The code can be found at https://github.com/labbots/OVPN-Config-Manipulator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment