How to rewrite an OpenVPN file
From wiki.IPBRICK.COM
Once you have the zip file, decompress it.
Then, open your .ovpn file. It will look like the one below.
# Generated by IPbrick - iPortalMais in 2014-Jan-10 19:01 client dev tun0 #dev-node MyTap proto tcp remote vpn.osvaldomatos.pt 1194 #remote-random resolv-retry infinite nobind user nobody group nogroup persist-key persist-tun #http-proxy-retry #http-proxy [proxy server] [proxy port] #mute-replay-warnings ca ca-server-mail.crt cert ipbricksupport.crt key ipbricksupport.key ns-cert-type server #tls-auth ta.key 1 #cipher x comp-lzo verb 2 #mute 20 #daemon
To rewrite it, add the following elements (as highlighted in red, in the picture below):
- ; or #
- <ca> </ca>
- <cert> </cert>
- <key> </key>
- The content of each file.
Note: Use a text editor to open the files and copy its content.
Your .ovpn file is now ready, it will look like the next one.
# Generated at 2016-Jan-22 17:01 client dev tun0 #dev-node MyTap proto tcp remote ipbrickc.domain.com 1194 #remote-random resolv-retry infinite nobind user nobody group nogroup persist-key persist-tun #http-proxy-retry #http-proxy [proxy server] [proxy port] #mute-replay-warnings #ca ca-server-ipbrick.crt <ca> -----BEGIN CERTIFICATE----- MIIDQzCCAqygAwIBAgIJAL4/4P/4J9XeMA0GCSqGSIb3DQEBBQUAMHUxCzAJBgNV BAYTAlBUMREwDwYDVQQIEwhwb3J0dWdhbDEOMAwGA1UEBxMFcG9ydG8xETAPBgNV BAoTCGlwYnJpY2tjMREwDwYDVQQDEwhpcGJyaWNrYzEdMBsGCSqGSIb3DQEJARYO dnBuQGRvbWFpbi5jb20wHhcNMTYwMTIyMTczNjEyWhcNMjYwMTE5MTczNjEyWjB1 MQswCQYDVQQGEwJQVDERMA8GA1UECBMIcG9ydHVnYWwxDjAMBgNVBAcTBXBvcnRv MREwDwYDVQQKEwhpcGJyaWNrYzERMA8GA1UEAxMIaXBicmlja2MxHTAbBgkqhkiG 9w0BCQEWDnZwbkBkb21haW4uY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKB gQC58LF9nnXRWlzvZygxIh31F/HLcYO5HUyyQmU7qvhWfqBofBrzzMNqrod0dHxX DBaAdzGP84U0a9vdIMhaqxgVtFGDpvjMfkp6XET4Wa1J5IIDRLAZAlPaMzGJ2iu1 JtsMrAI1Klh6ZKZQLjG1+42w7TmsjnWWUlMAh7+/YOTIgwIDAQABo4HaMIHXMB0G A1UdDgQWBBTWkOzZ3uyNfscrzDnDXLIhRDXIvjCBpwYDVR0jBIGfMIGcgBTWkOzZ 3uyNfscrzDnDXLIhRDXIvqF5pHcwdTELMAkGA1UEBhMCUFQxETAPBgNVBAgTCHBv cnR1Z2FsMQ4wDAYDVQQHEwVwb3J0bzERMA8GA1UEChMIaXBicmlja2MxETAPBgNV BAMTCGlwYnJpY2tjMR0wGwYJKoZIhvcNAQkBFg52cG5AZG9tYWluLmNvbYIJAL4/ 4P/4J9XeMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADgYEAVPeRJfwQvvSg iqXiX0pRgmrBHWFDADA9azHv/H0YT4MgSqs3o4XufkOaKJ8WXhw+517bKoPriXS2 5ZYqXP6pwIaQLntO6lcBDqvibO8VngLSCJrg+zfNc06PerbqIQGnWqnrhk8FeEZH IIMhGb4O23WDD1IC+vLvsNeBBm6rnM0= -----END CERTIFICATE----- </ca> #cert user.crt <cert> Certificate: Data: Version: 3 (0x2) Serial Number: 2 (0x2) Signature Algorithm: md5WithRSAEncryption Issuer: C=PT, ST=portugal, L=porto, O=ipbrickc, CN=ipbrickc/emailAddress=vpn@domain.com Validity Not Before: Jan 22 17:37:29 2016 GMT Not After : Jan 19 17:37:29 2026 GMT Subject: C=PT, ST=portugal, O=ipbrickc, CN=user/emailAddress=user@domain.com Subject Public Key Info: Public Key Algorithm: rsaEncryption Public-Key: (1024 bit) Modulus: 00:cc:de:f2:27:df:7c:fd:d5:78:ef:52:db:35:d1: b7:39:05:46:39:45:6f:2a:17:88:a2:3f:05:bd:17: 04:1f:cb:cd:93:bc:49:6f:31:ed:9b:8a:67:28:e8: bc:c6:99:41:6a:ce:18:6d:f6:71:a9:57:c9:d0:ea: 00:2e:b6:09:c5:17:ce:de:51:67:a1:be:2c:96:e2: a3:94:10:d5:9e:cc:1d:d4:d1:c6:5f:d0:10:18:e7: eb:99:e7:40:88:d8:ae:0f:49:a9:c5:3a:cc:b4:c6: 45:28:20:9a:2b:8e:80:22:7d:5c:bc:17:09:01:c3: 7b:af:ba:be:8d:eb:67:4a:bb Exponent: 65537 (0x10001) X509v3 extensions: X509v3 Basic Constraints: CA:FALSE Netscape Comment: OpenSSL Generated Certificate X509v3 Subject Key Identifier: 40:7C:52:C1:59:4E:9F:35:0F:87:BD:AB:80:D9:14:22:FA:D2:DD:DB X509v3 Authority Key Identifier: keyid:D6:90:EC:D9:DE:EC:8D:7E:C7:2B:CC:39:C3:5C:B2:21:44:35:C8:BE DirName:/C=PT/ST=portugal/L=porto/O=ipbrickc/CN=ipbrickc/emailAddress=vpn@domain.com serial:BE:3F:E0:FF:F8:27:D5:DE Signature Algorithm: md5WithRSAEncryption b7:97:09:b2:86:a1:89:df:b3:45:59:d9:2b:70:08:7d:7b:59: 9e:62:22:2d:25:d6:1c:e3:10:06:96:54:3d:24:12:ea:48:4d: 90:df:2d:4f:ec:63:69:30:53:a5:12:8b:c4:e9:c3:64:c2:28: d2:2e:93:f4:54:f5:67:84:9b:f8:f2:a7:3e:4e:4d:d0:e7:3f: 52:35:0c:b2:24:82:08:94:43:3e:69:23:41:51:0b:6e:e0:a6: de:39:23:e3:c7:7f:dc:87:d7:17:1c:c8:88:60:24:cd:cc:a5: 7e:c2:af:86:a0:7c:d3:93:57:f7:da:59:87:63:10:cb:f8:75: 6f:84 -----BEGIN CERTIFICATE----- MIIDVTCCAr6gAwIBAgIBAjANBgkqhkiG9w0BAQQFADB1MQswCQYDVQQGEwJQVDER MA8GA1UECBMIcG9ydHVnYWwxDjAMBgNVBAcTBXBvcnRvMREwDwYDVQQKEwhpcGJy aWNrYzERMA8GA1UEAxMIaXBicmlja2MxHTAbBgkqhkiG9w0BCQEWDnZwbkBkb21h aW4uY29tMB4XDTE2MDEyMjE3MzcyOVoXDTI2MDExOTE3MzcyOVowYjELMAkGA1UE BhMCUFQxETAPBgNVBAgTCHBvcnR1Z2FsMREwDwYDVQQKEwhpcGJyaWNrYzENMAsG A1UEAxMEdXNlcjEeMBwGCSqGSIb3DQEJARYPdXNlckBkb21haW4uY29tMIGfMA0G CSqGSIb3DQEBAQUAA4GNADCBiQKBgQDM3vIn33z91XjvUts10bc5BUY5RW8qF4ii PwW9FwQfy82TvElvMe2bimco6LzGmUFqzhht9nGpV8nQ6gAutgnFF87eUWehviyW 4qOUENWezB3U0cZf0BAY5+uZ50CI2K4PSanFOsy0xkUoIJorjoAifVy8FwkBw3uv ur6N62dKuwIDAQABo4IBBjCCAQIwCQYDVR0TBAIwADAsBglghkgBhvhCAQ0EHxYd T3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFEB8UsFZTp81 D4e9q4DZFCL60t3bMIGnBgNVHSMEgZ8wgZyAFNaQ7Nne7I1+xyvMOcNcsiFENci+ oXmkdzB1MQswCQYDVQQGEwJQVDERMA8GA1UECBMIcG9ydHVnYWwxDjAMBgNVBAcT BXBvcnRvMREwDwYDVQQKEwhpcGJyaWNrYzERMA8GA1UEAxMIaXBicmlja2MxHTAb BgkqhkiG9w0BCQEWDnZwbkBkb21haW4uY29tggkAvj/g//gn1d4wDQYJKoZIhvcN AQEEBQADgYEAt5cJsoahid+zRVnZK3AIfXtZnmIiLSXWHOMQBpZUPSQS6khNkN8t T+xjaTBTpRKLxOnDZMIo0i6T9FT1Z4Sb+PKnPk5N0Oc/UjUMsiSCCJRDPmkjQVEL buCm3jkj48d/3IfXFxzIiGAkzcylfsKvhqB805NX99pZh2MQy/h1b4Q= -----END CERTIFICATE----- </cert> #key user.key <key> -----BEGIN ENCRYPTED PRIVATE KEY----- MIICxjBABgkqhkiG9w0BBQ0wMzAbBgkqhkiG9w0BBQwwDgQIZF6UE7q3C7QCAggA MBQGCCqGSIb3DQMHBAhT5oGHIp+I8gSCAoCOhBIFtvIvc0FSvGjnD8UU97hxCYew pNLDwWiwys8+RS7tS7XbBlZAoV+IszPDP4QySy4CTZkBr/vRz1ZjZXvGM0RcN2F0 dz3CAF2hBjzvlqmWhkbUukDtiyYmW5JzMQz5E222ichUS4VNIFNJIqHQA+K4H5Xd KOXWJda5LD4AKnUVyOKcMn1NzH4vRMbqh94WY7OhZmoh+CzprY+iFFq8xQtKQomP iBe40Dh2HIYu35V4jaD0Uux6fE9vqswR5JSTdbnfaD9RqQXBtd7v6YuOI+xZ0zvm zNjzcCvse2vHVC3nadI32JtH6YnRQwUhHxabbD1TsAE8v8LC+I1zMY5/HiHf5cVJ VaHmsonSWbzLB6II+55lYjEG/UeEEj8YHGLDLigQUHwRgk45l9KXgXeiCUB34TNW OE9xVqUKqqAkRIFKfPwPIfpESmDu38tv3IHq1db+Aus1rRIv0OsExSJ9tqJaX1Hd Ja+XqvuRUaAqII9SbaAs+kecjWW45V5k0brj2QwO2DU+LGcu5a1uWTS4+T+W/t6K PnXJenwNi/HRWW7+LR43njCiJYaDo2yZ7GTrVgBqy4bwWyONmBxbhsQvo58KWE1i DvvufkSl10sYuo9BHdzey6xAssUuYlz42Pq3KKfWkxGRNBPU9Q53XGu10RzBca34 XJE5wZaoMdqZ/Gl3UiDvXeAmysmlEJ9exmKWC8n/YuIlvyj6Kh0mQpz/aAchlxBY K+MX9TZwhcBrMqgUDMk2MaNFV2Sw5o/+2pleZbLeV09sjEb4SZ8yDo8c9rOo13FC D9sHorrCsXqgDcA2ysB4M39fZR8QMI7w5SmvHKXpUu6Si05k1cHCZ2nF -----END ENCRYPTED PRIVATE KEY----- </key> ns-cert-type server #tls-auth ta.key 1 #cipher x comp-lzo verb 2 #mute 20 #daemon
If you wish to see the original files, you can find them here: http://downloads3.ipbrick.com/wiki/user.zip.
The .zip file contain the following files:
- ca-server-ipbrick.crt
md5sum: ca8153af46bf8cddab95a064e54c1474 ca-server-ipbrick.crt
- user.crt
md5sum: c7a060b8e842415586c25319188eac8b user.crt
- user.key
md5sum: c0898f304cef0dd56e38243937226883 user.key
- user.ovpn
md5sum: f03249bce06c8107c4d109faa34a75c8 user.ovpn