go: x/net/http2: HTTP/2 conformance failures using h2spec
What version of Go are you using (go version)?
go version 1.10.1 linux/arm64
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (go env)?
GOARCH="arm64"
GOBIN=""
GOEXE=""
GOHOSTARCH="arm64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/XXXX/go"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/linux_arm64"
GCCGO="gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build393280655=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
What did you do?
I’m using the h2spec program (https://github.com/summerwind/h2spec) and running the following command:
./h2spec -S -t -h caddyserver.com -p 443
What did you expect to see?
146 tests, 146 passed, 0 skipped, 0 failed
What did you see instead?
Failures:
Hypertext Transfer Protocol Version 2 (HTTP/2)
4. HTTP Frames
4.2. Frame Size
× 3: Sends a large size HEADERS frame that exceeds the SETTINGS_MAX_FRAME_SIZE
-> The endpoint MUST respond with a connection error of type FRAME_SIZE_ERROR.
Expected: GOAWAY Frame (Error Code: FRAME_SIZE_ERROR)
Connection closed
Actual: DATA Frame (length:0, flags:0x01, stream_id:1)
5. Streams and Multiplexing
5.1. Stream States
× 11: closed: Sends a DATA frame
-> The endpoint MUST treat this as a connection error of type STREAM_CLOSED.
Expected: GOAWAY Frame (Error Code: STREAM_CLOSED)
Connection closed
Actual: RST_STREAM Frame (length:4, flags:0x00, stream_id:1)
6. Frame Definitions
6.9. WINDOW_UPDATE
6.9.1. The Flow-Control Window
× 3: Sends multiple WINDOW_UPDATE frames increasing the flow control window to above 2^31-1 on a stream
-> The endpoint MUST sends a RST_STREAM frame with a FLOW_CONTROL_ERROR code.
Expected: RST_STREAM Frame (Error Code: FLOW_CONTROL_ERROR)
Actual: RST_STREAM Frame (length:4, flags:0x00, stream_id:1)
6.9.2. Initial Flow-Control Window Size
× 2: Sends a SETTINGS frame for window size to be negative
-> The endpoint MUST track the negative flow-control window.
Expected: DATA Frame (length:1, flags:0x00, stream_id:1)
Actual: Timeout
8. HTTP Message Exchanges
8.1. HTTP Request/Response Exchange
8.1.2. HTTP Header Fields
8.1.2.2. Connection-Specific Header Fields
× 1: Sends a HEADERS frame that contains the connection-specific header field
-> The endpoint MUST respond with a stream error of type PROTOCOL_ERROR.
Expected: GOAWAY Frame (Error Code: PROTOCOL_ERROR)
RST_STREAM Frame (Error Code: PROTOCOL_ERROR)
Connection closed
Actual: DATA Frame (length:51, flags:0x01, stream_id:1)
× 2: Sends a HEADERS frame that contains the TE header field with any value other than "trailers"
-> The endpoint MUST respond with a stream error of type PROTOCOL_ERROR.
Expected: GOAWAY Frame (Error Code: PROTOCOL_ERROR)
RST_STREAM Frame (Error Code: PROTOCOL_ERROR)
Connection closed
Actual: DATA Frame (length:53, flags:0x01, stream_id:1)
8.1.2.6. Malformed Requests and Responses
× 1: Sends a HEADERS frame with the "content-length" header field which does not equal the DATA frame payload length
-> The endpoint MUST treat this as a stream error of type PROTOCOL_ERROR.
Expected: GOAWAY Frame (Error Code: PROTOCOL_ERROR)
RST_STREAM Frame (Error Code: PROTOCOL_ERROR)
Connection closed
Actual: Timeout
× 2: Sends a HEADERS frame with the "content-length" header field which does not equal the sum of the multiple DATA frames payload length
-> The endpoint MUST treat this as a stream error of type PROTOCOL_ERROR.
Expected: GOAWAY Frame (Error Code: PROTOCOL_ERROR)
RST_STREAM Frame (Error Code: PROTOCOL_ERROR)
Connection closed
Actual: WINDOW_UPDATE Frame (length:4, flags:0x00, stream_id:0)
HPACK: Header Compression for HTTP/2
4. Dynamic Table Management
4.2. Maximum Table Size
× 1: Sends a dynamic table size update at the end of header block
-> The endpoint MUST treat this as a decoding error.
Expected: GOAWAY Frame (Error Code: COMPRESSION_ERROR)
Connection closed
Actual: DATA Frame (length:0, flags:0x01, stream_id:1)
146 tests, 137 passed, 0 skipped, 9 failed
As a Caddy contributor, I’m redirecting the original issue https://github.com/mholt/caddy/issues/2132 here because it’s an upstream issue
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 25 (11 by maintainers)
Commits related to this issue
- http2: dynamic table updates must occur first Dynamic table size updates must occur at the beginning of the first header block. Updates golang/go#25023 Change-Id: I7fd4f191da0a97cab26666545191460a6... — committed to golang/net by fraenkel 6 years ago
- http2: receiving too much data is a protocol error Updates golang/go#25023 Change-Id: Icd37dfef1b9558b0e774f1637c5566fb444666d5 Reviewed-on: https://go-review.googlesource.com/111679 Reviewed-by: Br... — committed to golang/net by fraenkel 6 years ago
- http2: correct overflow protection Correct overflow detection when going negative. Updates golang/go#25023 Change-Id: Ic2ddb7ee757f081d1826bfbbfd884e2b7e819335 Reviewed-on: https://go-review.google... — committed to golang/net by fraenkel 6 years ago
- http2: make Server send GOAWAY if Handler sets "Connection: close" header In Go's HTTP/1.x Server, a "Connection: close" response from a handler results in the TCP connection being closed. In HTTP/2... — committed to golang/net by bradfitz 6 years ago
- http2: reject incoming HEADERS in Server on half-closed streams Headers received on a half closed remote stream must respond with a stream error of type STREAM_CLOSED. Updates golang/go#25023 Chang... — committed to golang/net by fraenkel 6 years ago
- net/http: update bundled http2 Updates http2 to x/net/http2 git rev 292b43b for: http2: reject incoming HEADERS in Server on half-closed streams https://golang.org/cl/111677 Updates #25023 ... — committed to golang/go by fraenkel 6 years ago
- http2: a closed stream cannot receive data Data sent on a closed stream is treated as a connection error of type STREAM_CLOSED. Updates golang/go#25023 Change-Id: I3a94414101ec08c7a3f20d49cefc0367a... — committed to golang/net by fraenkel 6 years ago
- net/http: update bundled http2 Updates bundled x/net/http2 to git rev cffdcf67 for: http2: use GetBody unconditionally on Transport retry, when available https://golang.org/cl/123476 ht... — committed to golang/go by bradfitz 6 years ago
- vendor: update golang.org/x/net/http2/hpack Updates bundled golang.org/x/net/http2/hpack to x/net git rev 22bb95c5e for: http2/hpack: lazily build huffman table on first use https://golang.org... — committed to golang/go by bradfitz 6 years ago
- http2/hpack: track the beginning of a header block dynamic table size updates must occur at the beginning of the first header block. The original fix, golang/go#25023, guaranteed it was at the beginn... — committed to golang/net by fraenkel 6 years ago
- http2: Revert a closed stream cannot receive data This reverts CL 111676 for golang/go#25023. Reason for revert: The code change no longer issued a WindowUpdate which is required when processing dat... — committed to golang/net by fraenkel 6 years ago
These would be nice to fix but I don’t think any of them are critical. It’s nice that we do better than
google.comat least. 😃I agree let’s just keep this one bug for all of them.
/cc @tombergan
Sure
Can we get an updated summary of where we’re at on this bug using the latest (master) code?