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?
OpenVPN Connect fails to import valid ovpn file
-
- OpenVpn Newbie
- Posts: 5
- Joined: Thu Dec 13, 2018 9:18 am
-
- OpenVpn Newbie
- Posts: 6
- Joined: Thu Apr 02, 2020 7:14 am
Re: OpenVPN Connect fails to import valid ovpn file
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.
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.
-
- OpenVpn Newbie
- Posts: 2
- Joined: Sun Mar 24, 2024 5:48 pm
Re: OpenVPN Connect fails to import valid ovpn file
I commented out the following lines in the client config file before generating the .ovpn file:
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.
Code: Select all
# ca ca.crt
# cert client.crt
# key client.key
-
- OpenVpn Newbie
- Posts: 1
- Joined: Thu Nov 28, 2024 9:29 am
Re: OpenVPN Connect fails to import valid ovpn file
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.jafree wrote: ↑Sat Nov 09, 2019 10:13 pmI 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?