Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am developing a open source application wrapper over OpenVPN library for Android. For that I need to generate openvpn conf file.

I have followed OpenVPN how but did not understand how to generate .conf file on Android.

Is there any way to generate .conf/ .ovpn file locally on Android device ?

I could generate .cert and RSA private key and OpenVPN static key but I am still not clear about generating CA certificate for a particular client.

is there anything ( server side certificate /private key)I need to get from server.

I am still learning certificate based authentication for OpenVPN so my question can be a little naive so please bear with it :)

share|improve this question
up vote 1 down vote accepted

You have to write configuration files on your own. OpenVPN server administrator should provide client configuration file. Configuration file for client looks almost the same on Linux/Windows/Android/etc.. For client you have to generate "client certificate", not "CA certificate". Maybe you should read more about PKI ( If you are using certificates for authentication, then client should have configuration file, DH file, CA certificate, private and public client keys to work.

share|improve this answer

I have installed hundreds of OpenVPN servers and I never needed a DH file on the Client.

Server needs:

  • dh
  • ca.crt
  • ca.key
  • servername.crt
  • servername.key
  • optional (recommended) ta.key
  • a config file


  • the same ca.crt
  • clientname.crt
  • clientname.key
  • ta.key (if used in the server)
  • client.conf


share|improve this answer

dev tun
proto tcp
remote 1194

resolv-retry infinite


verb 1

keepalive 10 900
inactive 3600



share|improve this answer
Please see my edit to learn how to correctly format. Also, please add an actual explanation rather than just dumping a sample configuration file. – fukawi2 Dec 12 '14 at 4:28

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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