Closed
Description
The net/http.Server does:
// Serve a new connection.
func (c *conn) serve(ctx context.Context) {
...
if tlsConn, ok := c.rwc.(*tls.Conn); ok {
if d := c.server.ReadTimeout; d > 0 {
c.rwc.SetReadDeadline(time.Now().Add(d))
}
if d := c.server.WriteTimeout; d > 0 {
c.rwc.SetWriteDeadline(time.Now().Add(d))
}
if err := tlsConn.HandshakeContext(ctx); err != nil {
But if only Server.ReadHeaderTimeout
is set (and not ReadTimeout
), it seems like ReadHeaderTimeout
should be used for the TLS handshake deadline instead of infinite.
/cc @neild