Vpn

openvpn 設置客戶端后無法連接“無法載入內聯證書文件”

  • November 24, 2020

祝大家有美好的一天!

我最近嘗試為我的伺服器安裝和配置 openvpn。我已經創建了證書,隧道似乎至少可以通過 ifconfig 拍攝 tun0 已初始化。但是,當我嘗試使用憑據 (client.ovpn) 從我的 macbook 連接“tunnelblick”時,它沒有連接到伺服器。憑證已放置在 /etc/openvpn 中。問題是我必須使用“su”來創建憑據,而且我使用的是 centos 6.6。我很高興聽到你的任何建議。如果您需要更多關於此的資訊,請告訴我:)

謝謝 !

Ps抱歉重複

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

它找不到文件client.crt 和client.key。它們與您的 openvpn 配置文件位於同一文件夾中嗎?它們的名稱不同嗎?

引用自:https://serverfault.com/questions/726088