openvpn 设置客户端后无法连接“无法加载内联证书文件”

openvpn 设置客户端后无法连接“无法加载内联证书文件”

祝大家有个愉快的一天!

我最近尝试为我的服务器安装和配置 openvpn。我已经创建了证书,隧道似乎运行良好,至少 ifconfig 镜头显示 tun0 已初始化。但是当我尝试使用凭据 (client.ovpn) 从我的 macbook 连接“tunnelblick”时,它无法连接到服务器。凭据已放置在 /etc/openvpn 中。问题是我必须使用“su”来创建凭据,而且我使用的是 centos 6.6。我很乐意听取您的任何建议。此外,如果您需要更多信息,请告诉我 :)

谢谢 !

抱歉,重复了

Tunnelblick 错误日志:

*Tunnelblick: OS X 10.10.5; Tunnelblick 3.5.4 (build 4270.4395) 2015-10-01 01:23:43 
*Tunnelblick: Attempting connection with client using shadow copy; Set nameserver = 1; monitoring connection
*Tunnelblick: openvpnstart start client.tblk 1337 1 0 1 0 16688 -ptADGNWradsgnw 2.3.6
*Tunnelblick: openvpnstart log:
 OpenVPN started successfully. Command used to start OpenVPN (one argument per displayed line):

      /Applications/Tunnelblick.app/Contents/Resources/openvpn/openvpn-2.3.6/openvpn
      --daemon
      --log
      /Library/Application Support/Tunnelblick/Logs/-SUsers-Suser-SLibrary-SApplication Support-STunnelblick-SConfigurations-Sclient.tblk-SContents-SResources-Sconfig.ovpn.1_0_1_0_16688.1337.openvpn.log
      --cd
      /Library/Application Support/Tunnelblick/Users/user/client.tblk/Contents/Resources
      --config
      /Library/Application Support/Tunnelblick/Users/user/client.tblk/Contents/Resources/config.ovpn
      --cd
      /Library/Application Support/Tunnelblick/Users/user/client.tblk/Contents/Resources
      --management
      127.0.0.1
      1337
      --management-query-passwords
      --management-hold
      --script-security
      2
      --up
      /Applications/Tunnelblick.app/Contents/Resources/client.up.tunnelblick.sh -d -f -m -w -ptADGNWradsgnw
      --down
      /Applications/Tunnelblick.app/Contents/Resources/client.down.tunnelblick.sh -d -f -m -w -ptADGNWradsgnw
*Tunnelblick: openvpnstart starting OpenVPN
OpenVPN 2.3.6 x86_64-apple-darwin [SSL (OpenSSL)] [LZO] [PKCS11] [MH] [IPv6] built on Sep 19 2015
library versions: OpenSSL 1.0.1p 9 Jul 2015, LZO 2.08
MANAGEMENT: TCP Socket listening on [AF_INET]127.0.0.1:1337
Need hold release from management interface, waiting...
*Tunnelblick: Established communication with OpenVPN
MANAGEMENT: Client connected from [AF_INET]127.0.0.1:1337
MANAGEMENT: CMD 'pid'
MANAGEMENT: CMD 'state on'
MANAGEMENT: CMD 'state'
MANAGEMENT: CMD 'bytecount 1'
MANAGEMENT: CMD 'hold release'
WARNING: No server certificate verification method has been enabled.  See http://openvpn.net/howto.html#mitm for more info.
NOTE: the current --script-security setting may allow this configuration to call user-defined scripts
MANAGEMENT: Client disconnected
Cannot load inline certificate file: error:0906D06C:PEM routines:PEM_read_bio:no start line: error:140AD009:SSL routines:SSL_CTX_use_certificate_file:PEM lib
Exiting due to fatal error
*Tunnelblick: No 'post-disconnect.sh' script to execute
*Tunnelblick: Expected disconnection occurred.

/var/log/message 告诉我的内容如下。有 client.crt/*.key 错误,我不知道如何修复。更具体地说,我不知道应该编辑哪个文件:

openvpn[974]: Options error: --cert fails with 'client.crt': No such file or directory
openvpn[974]: Options error: --key fails with 'client.key': No such file or directory
openvpn[974]: Options error: Please correct these errors.
openvpn[974]: Use --help for more information.
openvpn[978]: OpenVPN 2.3.8 x86_64-unknown linux-gnu [SSL (OpenSSL)] [LZO] [EPOLL] [MH] [IPv6] built on Sep 28 2015
openvpn[978]: library versions: OpenSSL 1.0.1e-fips 11 Feb 2013, LZO 2.03
openvpn[979]: Diffie-Hellman initialized with 2048 bit key
openvpn[979]: Socket Buffers: R=[212992->131072] S=[212992->131072]
openvpn[979]: ROUTE_GATEWA 5.254.254.254/255.255.255.0 IFACE=eth0 HWADDR=22:22:22:22:22:22
openvpn[979]: TUN/TAP device tun0 opened
openvpn[979]: TUN/TAP TX queue length set t 100
openvpn[979]: do_ifconfig, tt->ipv6=0, tt->did_ifconfig_ipv6_setup=0
openvpn[979]: /sbin/ifconfig tun0 10.8.0.1 pointopoint 10.8.0.2 mtu 1500
openvpn[979]: /sbin/route add -net 10.8.0.0 netmask 255.255.255.0 gw 10.8.0.2
openvpn[979]: GID set to nobody
openvpn[979]: UID set to nobody
openvpn[979]: UDPv4 link local (bound) [undef]
openvpn[979]: UDPv4 link remote: [undef]
openvpn[979]: MULTI: multi_init called, r=256 v=256
openvpn[979]: IFCONFIG POOL: base=10.8.0.4 size=62, ipv6=0
openvpn[979]: IFCONFIG POOL LIST
openvpn[979]: Initialization Sequence
Completed

答案1

它找不到文件 client.crt 和 client.key。它们和你的 openvpn 配置文件在同一个文件夹中吗?它们的名称不同吗?

相关内容