通过SSL连接到OpenVPN服务器的问题

时间:2020-09-08 12:35:44

标签: openvpn tcpportsharing

我通过sslh连接到OpenVPN服务器时遇到问题。

以下是配置文件:

sslh

Run=yes
DAEMON=/usr/sbin/sslh
DAEMON_OPTS="--user sslh --listen 0.0.0.0:443 --openvpn 127.0.0.1:1149 --ssl 127.0.0.1:4443 --ssh 127.0.0.1:22 --timeout 20 --pidfile /var/run/sslh/sslh.pid"

OpenVPN服务器

local x.x.x.x
port 1194
proto tcp
dev tun
ca ca.crt
cert server.crt
key server.key
dh dh.pem
auth SHA512
tls-crypt tc.key
topology subnet
server 10.8.0.0 255.255.255.0
server-ipv6 fddd:1194:1194:1194::/64
push "redirect-gateway def1 ipv6 bypass-dhcp"
ifconfig-pool-persist ipp.txt
push "dhcp-option DNS x.x.x.x"
push "dhcp-option DNS x.x.x.x"
keepalive 10 120
cipher AES-256-CBC
user nobody
group nogroup
persist-key
persist-tun
status openvpn-status.log
verb 3
crl-verify crl.pem

OpenVPN客户端

client
dev tun
proto tcp
remote x.x.x.x 443
resolv-retry infinite
nobind
persist-key
persist-tun
remote-cert-tls server
auth SHA512
cipher AES-256-CBC
ignore-unknown-option block-outside-dns
block-outside-dns
verb 3

这是VPN客户端的日志

Tue Sep 8 14:01:38 2020 Unrecognized option or missing or extra parameter(s) in vpn.ovpn:13: block-outside-dns (2.4.7)
Tue Sep 8 14:01:38 2020 OpenVPN 2.4.7 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [PKCS11] [MH/PKTINFO] [AEAD] built on Sep 5 2019
Tue Sep 8 14:01:38 2020 library versions: OpenSSL 1.1.1f 31 Mar 2020, LZO 2.10
Tue Sep 8 14:01:38 2020 Outgoing Control Channel Encryption: Cipher 'AES-256-CTR' initialized with 256 bit key
Tue Sep 8 14:01:38 2020 Outgoing Control Channel Encryption: Using 256 bit message hash 'SHA256' for HMAC authentication
Tue Sep 8 14:01:38 2020 Incoming Control Channel Encryption: Cipher 'AES-256-CTR' initialized with 256 bit key
Tue Sep 8 14:01:38 2020 Incoming Control Channel Encryption: Using 256 bit message hash 'SHA256' for HMAC authentication
Tue Sep 8 14:01:38 2020 TCP/UDP: Preserving recently used remote address: [AF_INET]185.119.98.171:443
Tue Sep 8 14:01:38 2020 Socket Buffers: R=[131072->131072] S=[16384->16384]
Tue Sep 8 14:01:38 2020 Attempting to establish TCP connection with [AF_INET]185.119.98.171:443 [nonblock]
Tue Sep 8 14:01:39 2020 TCP connection established with [AF_INET]185.119.98.171:443
Tue Sep 8 14:01:39 2020 TCP_CLIENT link local: (not bound)
Tue Sep 8 14:01:39 2020 TCP_CLIENT link remote: [AF_INET]185.119.98.171:443
Tue Sep 8 14:01:39 2020 Connection reset, restarting [0]
Tue Sep 8 14:01:39 2020 SIGUSR1[soft,connection-reset] received, process restarting
Tue Sep 8 14:01:39 2020 Restart pause, 5 second(s)

我可以连接到SSH或SSL,但不能连接到vpn。已经尝试从sslh config中删除--ssl和--ssh选项,并添加--anyprot 127.0.0.1:1149。

OpenVPN服务器和客户端版本:2.4.7
sslh版本:sslh-fork 1.20-1

0 个答案:

没有答案