简体   繁体   English

Golang:http2和TLS握手错误

[英]Golang: http2 and TLS handshake errors

I have a Go application with both http (on port 80) and https (on port 443) enabled. 我有一个Go应用程序,启用了http(在端口80上)和https(在端口443上)。

I keep getting lots of these 3 kinds of error: 我不断收到很多这三种错误:

  • 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

can anyone explain what these refer to? 任何人都可以解释这些是指什么?

Note that: all these requests are coming from mobile browsers (on Android and iOS devices) 请注意:所有这些请求都来自移动浏览器(在Android和iOS设备上)

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

This means that the client failed to send the http2 connection preface ( https://tools.ietf.org/html/rfc7540#section-3.5 ) before the server timed out. 这意味着客户端在服务器超时之前未能发送http2连接前言( https://tools.ietf.org/html/rfc7540#section-3.5 )。

http: TLS handshake error from 151.38.29.250:44235: EOF

This means that while the server and the client were performing the TLS handshake, the server saw the connection being closed, aka EOF. 这意味着当服务器和客户端执行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

This means that while the server was waiting to read from the client during the TLS handshake, the client didn't send anything before closing the connection. 这意味着当服务器在TLS握手期间等待从客户端读取时,客户端在关闭连接之前没有发送任何内容。

As @JimB pointed out, those are perfectly normal to see. 正如@JimB指出的那样,那些看起来很正常。 If you think the timeouts are kicking in too soon, you can define custom ones by defining a custom net.http.Transport : https://golang.org/pkg/net/http/#Transport , and set higher values for timeouts. 如果您认为超时时间过早,您可以通过定义自定义net.http.Transport来定义自定义net.http.Transporthttpsnet.http.Transport ,并为超时设置更高的值。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM