OpenVPN Connect fails to import valid ovpn file

Official client software for OpenVPN Access Server and OpenVPN Cloud.
Post Reply
jafree
OpenVpn Newbie
Posts: 5
Joined: Thu Dec 13, 2018 9:18 am

OpenVPN Connect fails to import valid ovpn file

Post by jafree » Sat Nov 09, 2019 10:13 pm

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?

Techie
OpenVpn Newbie
Posts: 6
Joined: Thu Apr 02, 2020 7:14 am

Re: OpenVPN Connect fails to import valid ovpn file

Post by Techie » Wed Apr 08, 2020 10:54 am

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.

lcreid
OpenVpn Newbie
Posts: 2
Joined: Sun Mar 24, 2024 5:48 pm

Re: OpenVPN Connect fails to import valid ovpn file

Post by lcreid » Sun Mar 24, 2024 5:55 pm

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.

esteban78
OpenVpn Newbie
Posts: 1
Joined: Thu Nov 28, 2024 9:29 am

Re: OpenVPN Connect fails to import valid ovpn file

Post by esteban78 » Thu Nov 28, 2024 9:31 am

jafree wrote:
Sat Nov 09, 2019 10:13 pm
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?
The .ovpn file issue with iOS devices is often resolved by changing line endings to Unix format. This is a known limitation of the iOS VPN client.

Post Reply