首页 > 解决方案 > 在 pptpd vpn 服务器之后运行 docker 容器时的 tls 握手超时

问题描述

如何重现它:

  1. 创建一个PPTP服务器
  2. 从您的主机连接 PPTP 服务器
  3. 在你的主机上运行一个 Debian docker 容器
  4. 在 Docker 容器中运行此命令: curl --insecure -v -i https://www.google.com
  5. 得到以下结果:
* Rebuilt URL to: https://google.com/
*   Trying 216.58.221.238...
* TCP_NODELAY set
* Connected to google.com (216.58.221.238) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
*   CAfile: /etc/ssl/certs/ca-certificates.crt
  CApath: /etc/ssl/certs
* TLSv1.2 (OUT), TLS header, Certificate Status (22):
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* Unknown SSL protocol error in connection to google.com:443 
* Curl_http_done: called premature == 1
* stopped the pause stream!
* Closing connection 0

如果您执行以下任一操作,则不会发生此问题:

  1. 不要使用 PPTP 服务器,并在 docker 容器中运行 curl
  2. 不要使用 docker 容器,并在您的主机中运行 curl,该主机位于 pptpd 服务器之后
  3. 不要连接到https://www.google.com,而是在相同的 VPN 和 docker 条件下连接到https://www.wordpress.com

标签: dockerssltls1.2

解决方案


原来是PPTP MTU问题。我必须将 ppp0 的 mtu 设置为较低的值以防止出现此问题。


推荐阅读