OpenVPN configuration in a single file

The benefit of a single configuration file is that it can be used on mobile devices where OpenVPN Connect is the official client.

First, open the client .conf or .ovpn file and delete the following lines

Then, insert file contents into following parts accordingly, namely ca.crt, client.crt, client.key and ta.key.
Do not forget to uncomment the first key-direction line if exists tls-auth.

Moreover, if it is configured to use a static key, just replace the line secret some.key with


Oct 5, 2016 @ 13:12

5 thoughts on “OpenVPN configuration in a single file”

  1. Thank you for manual.
    Do you know how to save private password in one file config ?
    I’m using askpass pass.txt, but it will be second file.
    Is there exist or similar directive ?

    1. Hi tomi,

      Glad it helps, as for your question, there are possible solutions as follows,

      1. The password brings about better security in addition to the keys. To leave it in plain text is opposite to its purpose.
      2. On the OpenVPN side, the directive <askpass></askpass> might be tried. However, I haven’t tested it yet.
      3. On the key side, there is an OpenSSL command openssl rsa -in [file1.key] -out [file2.key]. Type in the passphrase for file1, export file2 unencrypted and use file2 then.


Leave a Reply

Your email address will not be published. Required fields are marked *

Please calculate * Time limit is exhausted. Please reload CAPTCHA.