Golang: http2 and TLS handshake errors
Asked Answered
C

1

16

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)

Centreboard answered 17/9, 2016 at 13:37 Comment(1)
if these clients aren't yours, just ignore them. Poorly behaving clients, timeouts, and disconnects on the Internet are nothing new or unexpected.Xanthin
F
13
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.

Foulard answered 17/9, 2016 at 16:1 Comment(3)
Frederik, thanks for your valuable explanation. Considering that all these requests are coming from mobile browsers (on Android and iOS devices), do you see some specific reasons for this? Many thanksCentreboard
Yes, mobile connections tend to have higher RTTs, lower bandwidth and see more packet loss.Foulard
Have seen these errors pop up more often when the user's internet connection is too slow and the app build is too big.Goode

© 2022 - 2024 — McMap. All rights reserved.