Page 1 of 1

OpenVPN Connect fails to import valid ovpn file

Posted: Sat Nov 09, 2019 10:13 pm
by jafree
I created a perfectly valid ovpn file to import onto an iOS phone. I repeatedly got an error that said "file is not UTF8".
I ran it through multiple apps to convert/check it. I used a hex editor to examine the file. Nothing was there except plain text.

Finally, I tried changing the line endings from "Windows" to "Unix". Then the file worked.

So, the error was incorrect. It wasn't reading it because of the line-endings but also, can you please make the client handle CR/LF line endings?

Re: OpenVPN Connect fails to import valid ovpn file

Posted: Wed Apr 08, 2020 10:54 am
by Techie
Here are some basic pointers for importing .ovpn files:

When you import a .ovpn file, make sure that all files referenced by the .ovpn file such as ca, cert, and key files are in the same directory on the device as the .ovpn file.
Profiles must be UTF-8 (or ASCII) and under 256 KB in size.
Consider using the unified format for OpenVPN profiles which allows all certs and keys to be embedded into the .ovpn file.

Re: OpenVPN Connect fails to import valid ovpn file

Posted: Sun Mar 24, 2024 5:55 pm
by lcreid
I commented out the following lines in the client config file before generating the .ovpn file:

Code: Select all

# ca ca.crt
# cert client.crt
# key client.key
I suspect that the client on Macos was looking for those files, even though the keys are in the .ovpn file, and failing when it doesn't find them.