Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Golang: http2 and TLS handshake errors

I have a Go application with both http (on port 80) and https (on port 443) enabled.

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)

like image 437
Daniele B Avatar asked Sep 17 '16 13:09

Daniele B


Video Answer


1 Answers

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://www.rfc-editor.org/rfc/rfc7540#section-3.5) before the server timed out.

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.

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.

As @JimB pointed out, those are perfectly normal to see. 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.

like image 183
Frederik Deweerdt Avatar answered Oct 17 '22 18:10

Frederik Deweerdt