环境 Environment
OpenVPN Server: ArmBian, OpenVPN 2.5.1
OpenVPN Client1: PC, Windows 10 LTSC 21H2(2021), OpenVPN GUI v11.25.00
OpenVPN Client2: PC, Windows 10 LTSC 1809(2019), OpenVPN GUI v11.25.00
OpenVPN Client3: iPhone SE 2nd(第二代), iOS 14.1, OpenVPN Connect Version 3.2.3(3760)
OpenVPN Client4: Macbook Pro i5, macOS Big Sur 11.6, OpenVPN Connect Version 3.3.2(4125)
问题描述 Problem Description
Windows PC 都可正常连接到 OpenVPN 服务器,并且正常使用。
All Windows PCs can connect to the OpenVPN server and use it normally.
iPhone 通过 AppStore 安装 OpenVPN Connect,会出现以下错误。
iPhone install OpenVPN Connect through AppStore, the following error will appear.
MacBook 通过 OpenVPN 官网下载安装 OpenVPN Connect,会出现以下错误。
MacBook downloads and installs OpenVPN Connect through the OpenVPN official website, the following error will appear.
以下步骤中确保 ca.crt, client.crt, client.key, ta.key 对应的内容都百分百正确,不存在错误。
In the following steps, make sure that the contents of ca.crt, client.crt, client.key, ta.key are 100% correct and there are no errors.
以下操作中的访达(Finder)等同于 iTunes,AirDrop。
The Finder in the following operations is equivalent to iTunes and AirDrop.
解决 Solve
iPhone
中文
通过访达(Finder)在 OpenVPN 中导入以下 5 个文件,确保文件都在同一目录。
- 含 ca.crt, client.crt, client.key, ta.key 的 client.ovpn 文件
- 单独的 ca.crt, client.crt, client.key, ta.key,共 4 个文件。
再在 OpenVPN Connect -> Import Profile 的 File 中 ADD 配置文件,导入成功;连接 OpenVPN 服务器,成功。
最后,可删除单独导入的 4 个文件(不影响 OpenVPN 的连接与使用):ca.crt, client.crt, client.key, ta.key。
English
Import the following files in OpenVPN through Finder(iTunes), then make sure that the five files are in the same directory.
- Client.ovpn file with contents of ca.crt, client.crt, client.key, ta.key.
- Separate 4 files of ca.crt, client.crt, client.key, ta.key.
After that, you can successfully ADD the ovpn configuration file, and you can successfully connect to the openvpn server.
Finally, you can delete the 4 files imported separately (does not affect the connection and use of OpenVPN): ca.crt, client.crt, client.key, ta.key.
Enjoy it.
Macbook
中文
新建一个文件夹,将以下文件放入其中,确保所有文件都在同一目录。
- 含 ca.crt, client.crt, client.key, ta.key 的 client.ovpn 文件
- 单独的 ca.crt, client.crt, client.key, ta.key,共 4 个文件。
将 client.ovpn 拖入 OpenVPN Connect 中,之后即可连接并使用 OpenVPN。
English
Create a new folder, put the following files in it, and make sure all files are in the same directory.
- Client.ovpn file with contents of ca.crt, client.crt, client.key, ta.key.
- Separate 4 files of ca.crt, client.crt, client.key, ta.key.
Drag client.ovpn into OpenVPN Connect, and then you can connect and use OpenVPN. Enjoy it.
情况一 Problem 1
iPhone 与 Macbook 均会出现以下错误,虽然部分提示不一致,但是错误一致。
Both iPhone and Macbook will have the following errors. Although some of the prompts are inconsistent, the errors are the same.
中文
通过访达(Finder)在 OpenVPN 中导入含 ca.crt, client.crt, client.key, ta.key 的 client.ovpn 文件后,OpenVPN Connect ADD 配置文件,报错。
English
After importing the Client.ovpn file with contents of (ca.crt, client.crt, client.key, ta.key) in OpenVPN through the Finder, OpenVPN Connect ADD configuration file and an error is reported.
报错信息 Error
Failed to Import Profile
Failed to import Profile: ca.crt, client.crt, client.key, ta.key.
情况二 Problem 2
中文
通过访达(Finder)导入不含 ca.crt, client.crt, client.key, ta.key 的 client.ovpn 文件,以及单独的 ca.crt, client.crt, client.key, ta.key,总共 5 个文件后,再在 OpenVPN Connect Import Profile 的 File 中 ADD 配置文件,结果导入成功。
但是,在连接 OpenVPN 服务器时,报错。
尝试将 ca.crt 导入 iPhone 的描述文件中,无效,仍然报错。
English
Import the following files in OpenVPN through Finder(iTunes), then make sure that the files are in the same directory.
- Client.ovpn file without contents of ca.crt, client.crt, client.key, ta.key.
- Separate 4 files of ca.crt, client.crt, client.key, ta.key.
Add the configuration file in the File of OpenVPN Connect Import Profile, and the import is successful.
However, when connecting to the OpenVPN server, an error is reported.
Try to import ca.crt into the iPhone description file, but it is invalid, and an error is still reported.
报错信息 Error
There was an eoor attempting to connect to the selected server.
Error message: ssl_context_error:
OpenSSLContext: CA not defined.
相关的问题 Related issues
MacBook macOS 怎么导入 .ovpn 文件,连接 OpenVPN。
iPhone iOS 怎么导入 .ovpn 文件,连接 OpenVPN。
How to import .ovpn files on MacBook macOS and connect to OpenVPN.
How to import .ovpn files on iPhone iOS and connect to OpenVPN.