I have an openvpn server running and I can connect to it with the following client config file:
client
dev tun
proto udp
remote myremote 1194
resolv-retry infinite
nobind
persist-key
persist-tun
remote-cert-tls server
cipher AES-256-CBC
verb 3
comp-lzo
ca C:\\Users\\Alex\\Downloads\\ca.crt
cert C:\\Users\\Alex\\Downloads\\client.crt
key C:\\Users\\Alex\\Downloads\\client.key
tls-auth C:\\Users\\Alex\\Downloads\\ta.key 1
but I'm not able to do so using this profile:
client
dev tun
proto udp
remote myremote 1194
resolv-retry infinite
nobind
persist-key
persist-tun
remote-cert-tls server
cipher AES-256-CBC
verb 3
comp-lzo
<ca>
-----BEGIN CERTIFICATE-----
-----
-----END CERTIFICATE-----
</ca>
<cert>
-----
-----BEGIN CERTIFICATE-----
-----END CERTIFICATE-----
</cert>
<key>
-----BEGIN PRIVATE KEY-----
----
-----END PRIVATE KEY-----
</key>
<tls-auth>
#
# 2048 bit OpenVPN static key
#
-----BEGIN OpenVPN Static key V1-----
----
-----END OpenVPN Static key V1-----
</tls-auth>
I copy & pasted all the certs/keys from the non working one to the separated files and it works as it should.
Using the profile, this error appears:
Fri Feb 08 19:06:01 2019 TLS Error: TLS key negotiation failed to occur within 60 seconds (check your network connectivity)
Fri Feb 08 19:06:01 2019 TLS Error: TLS handshake failed
Server: Ubuntu 16
Client: Windows 10