Golang:http2和TLS握手错误

Dan*_*e B 10 ssl https go sslhandshakeexception http2

我有一个Go应用程序,启用了http(在端口80上)和https(在端口443上).

我不断收到很多这三种错误:

  • http2: server: error reading preface from client 79.49.31.60:37993: timeout waiting for client preface

  • http: TLS handshake error from 151.38.29.250:44235: EOF

  • http: TLS handshake error from 2.239.197.163:6742: read tcp x.xxx.xxx.xxx:443->2.239.197.163:6742: i/o timeout

任何人都可以解释这些是指什么?

请注意:所有这些请求都来自移动浏览器(在Android和iOS设备上)

Fre*_*rdt 8

http2: server: error reading preface from client 79.49.31.60:37993: timeout waiting for client preface
Run Code Online (Sandbox Code Playgroud)

这意味着客户端在服务器超时之前未能发送http2连接前言(https://tools.ietf.org/html/rfc7540#section-3.5).

http: TLS handshake error from 151.38.29.250:44235: EOF
Run Code Online (Sandbox Code Playgroud)

这意味着当服务器和客户端执行TLS握手时,服务器看到连接已关闭,即EOF.

http: TLS handshake error from 2.239.197.163:6742: read tcp x.xxx.xxx.xxx:443->2.239.197.163:6742: i/o timeout
Run Code Online (Sandbox Code Playgroud)

这意味着当服务器在TLS握手期间等待从客户端读取时,客户端在关闭连接之前没有发送任何内容.

正如@JimB指出的那样,那些看起来很正常.如果您认为超时时间过早,您可以通过定义自定义来定义自定义net.http.Transport:https://golang.org/pkg/net/http/#Transport,并为超时设置更高的值.