我有一个以下格式的 ovpn 文件。
client
dev tun
proto udp
remote MY_IP 1194
resolv-retry infinite
nobind
persist-key
persist-tun
mute-replay-warnings
ns-cert-type server
key-direction 1
cipher AES-128-CBC
comp-lzo
verb 1
mute 20
-----BEGIN CERTIFICATE-----
M---DeletedContent
+Jl7
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
DeletedContentYsuN5d
-----END CERTIFICATE-----
-----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED
DEK-Info: DES-EDE3-CBC,EB9C4DDDD26848F5
PDeletedContent
-----END RSA PRIVATE KEY-----
#
# 2048 bit OpenVPN static key
#
-----BEGIN OpenVPN Static key V1-----
DeletedContent
-----END OpenVPN Static key V1-----
当我尝试使用 OVPN 2.4.4 打开它时出现以下错误:
选项错误:C:\Users\Stevens\Desktop\user01.ovpn:17 中无法识别的选项或缺失或多余的参数:---BEGIN (2.4.4) 使用 --help 获取更多信息。按任意键继续...
第 17 行是第一个 -----BEGIN CERTIFICATE-----。我做错了什么??
答案1
您需要将您的证书包装在合适的块指令中,我的类似文件具有这种结构
...
<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>