Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

3 Answers 3

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 (http://bit.ly/YP5dvZ). 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

Client:

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

Regards!

share|improve this answer
client

dev tun
proto tcp
remote 1.2.3.4 1194

resolv-retry infinite
nobind

persist-key
persist-tun

verb 1

keepalive 10 900
inactive 3600
comp-lzo

<ca>
-----BEGIN CERTIFICATE-----
....................................
-----END CERTIFICATE-----
</ca>

<cert>
-----BEGIN CERTIFICATE-----
...........................
-----END CERTIFICATE-----
</cert>

<key>
-----BEGIN RSA PRIVATE KEY-----
.....................
-----END RSA PRIVATE KEY-----
</key>
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 at 4:28

Your Answer

 
discard

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.