【问题标题】:openvpn error: TLS Error: TLS key negotiation failed to occur within 60 seconds [closed]openvpn错误:TLS错误:TLS密钥协商未能在60秒内发生[关闭]
【发布时间】:2011-11-02 13:59:56
【问题描述】:

我在 openvpn 的实现上遇到了问题,所以我在这里,希望有人可以帮助我

故事:

我已经在 ubuntu 服务器 VPS 上安装了 openvpn 服务器,并且我使用了 tun 点对点而不是 Tap bridge。 没有服务器上未配置导致的错误。

当我在客户端发出 openvpn client.conf 命令时,它给了我:

Thu Oct 27 15:17:39 2011 OpenVPN 2.1.0 i686-pc-linux-gnu [SSL] [LZO2] [EPOLL] [PKCS11] [MH] [PF_INET6] [eurephia] built on Jul 12 2010
Thu Oct 27 15:17:39 2011 NOTE: OpenVPN 2.1 requires '--script-security 2' or higher to call user-defined scripts or executables
Thu Oct 27 15:17:39 2011 /usr/bin/openssl-vulnkey -q -b 1024 -m <modulus omitted>
Thu Oct 27 15:17:39 2011 LZO compression initialized
Thu Oct 27 15:17:39 2011 Control Channel MTU parms [ L:1544 D:140 EF:40 EB:0 ET:0 EL:0 ]
Thu Oct 27 15:17:39 2011 Data Channel MTU parms [ L:1544 D:1450 EF:44 EB:135 ET:0 EL:0 AF:3/1 ]
Thu Oct 27 15:17:39 2011 Local Options hash (VER=V4): '69109d17'
Thu Oct 27 15:17:39 2011 Expected Remote Options hash (VER=V4): 'c0103fa8'
Thu Oct 27 15:17:39 2011 Attempting to establish TCP connection with [AF_INET]VPS_IP_ADDR:4242 [nonblock]
Thu Oct 27 15:17:40 2011 TCP connection established with [AF_INET]VPS_IP_ADDR:PORT_NUM
Thu Oct 27 15:17:40 2011 Socket Buffers: R=[87380->131072] S=[16384->131072]
Thu Oct 27 15:17:40 2011 TCPv4_CLIENT link local: [undef]
Thu Oct 27 15:17:40 2011 TCPv4_CLIENT link remote: [AF_INET]VPS_IP_ADDR:4242
Thu Oct 27 15:17:40 2011 TLS: Initial packet from [AF_INET]VPS_IP_ADDR:4242, sid=b78095e0 079e400c
Thu Oct 27 15:18:40 2011 TLS Error: TLS key negotiation failed to occur within 60 seconds (check your network connectivity)
Thu Oct 27 15:18:40 2011 TLS Error: TLS handshake failed
Thu Oct 27 15:18:40 2011 Fatal TLS error (check_tls_errors_co), restarting
Thu Oct 27 15:18:40 2011 TCP/UDP: Closing socket
Thu Oct 27 15:18:40 2011 SIGUSR1[soft,tls-error] received, process restarting
Thu Oct 27 15:18:40 2011 Restart pause, 5 second(s)

当我搜索问题时,我发现人们和 openvpn 手册本身都说这是由服务器的防火墙配置引起的

这是我的规则:

iptables -A INPUT -p tcp --dport 4242 -j ACCEPT
iptables -A OUTPUT -p tcp --sport 4242 -j ACCEPT
iptables -A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -s 10.8.0.0/24 -j ACCEPT
iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -j SNAT --to VPS_IP_ADDR

【问题讨论】:

    标签: linux networking ssl openvpn


    【解决方案1】:

    请在服务器端检查您的日志。 在我的情况下,TLS 密钥协商错误和用户丢失是由于 OpenVPN 达到了最大客户端。我从 5 变成了 10 并且像一个魅力一样工作。只需检查您的服务器日志。

    【讨论】:

      【解决方案2】:

      尝试在 *.ovpn 配置文件下面添加 cmd:

      up /etc/openvpn/update-resolv-conf
      down /etc/openvpn/update-resolv-conf
      

      然后使用 cmd 打开 openvpn:

      openvpn --cd /Path/to/your/configs --config *.ovpn 
      

      【讨论】:

        【解决方案3】:

        取消注释客户端配置 {ovpn} 文件中的 TLS-Auth 键并验证服务器 ta.key

        后,此错误清除

        【讨论】:

        • 您如何验证 ta.key?遇到一个非常相似的问题
        • 抱歉这么晚了,你只是跟踪错误日志,对我来说问题是与 NTP 相关的没有正确修复,所以总是给过期的 ta.key
        猜你喜欢
        • 1970-01-01
        • 2020-04-28
        • 2019-08-18
        • 1970-01-01
        • 2017-05-13
        • 2016-04-20
        • 1970-01-01
        • 2021-04-07
        • 1970-01-01
        相关资源
        最近更新 更多