question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Http2: server rejects request with valid :protocol pseudo header

See original GitHub issue

Expected behavior

Server accepts request with :protocol pseudo header (defined in RFC8441) , if its initial settings contain SETTINGS_ENABLE_CONNECT_PROTOCOL SETTINGS=1.

Actual behavior

Request is rejected

io.netty.handler.codec.http2.Http2Exception$StreamException: Invalid HTTP/2 pseudo-header ':protocol' encountered.
	at io.netty.handler.codec.http2.Http2Exception.streamError(Http2Exception.java:147)
	at io.netty.handler.codec.http2.HpackDecoder.validate(HpackDecoder.java:393)

Suboptimal workaround is configuring server’s Http2ConnectionHandler with http2Builder.validateHeaders(false)

Steps to reproduce

Minimal yet complete reproducer code (or URL to code)

https://github.com/jauntsdn/netty-websocket-http2/tree/feature/http2-protocol-header-reject

start ./channel_server.sh
start ./channel_client.sh

Netty version

4.1.51.Final

JVM version (e.g. java -version)

OS version (e.g. uname -a)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:12 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
mostroverkhovcommented, Apr 30, 2022

It seems this is fixed already by https://github.com/netty/netty/pull/11192 in a very straightforward way, closing

1reaction
carl-mastrangelocommented, Aug 3, 2020

This might be reasonable to support with the Http2ConnectionHandler, but not from the Multiplex handler. Netty /is/ compliant with RFC 7540 which states:

Endpoints MUST treat a request or response that contains undefined or invalid pseudo-header fields as malformed

Read more comments on GitHub >

github_iconTop Results From Across the Web

RFC 7540 - Hypertext Transfer Protocol Version 2 (HTTP/2)
HTTP/2 enables a more efficient use of network resources and a reduced ... Pseudo-header fields are only valid in the context in which...
Read more >
TcpProxy improperly sets `:protocol=bytestream` for HTTP2 ...
TcpProxy improperly sets :protocol=bytestream for HTTP2: When using TunnelingConfig for an HTTP/2 tunnel, it send an out-of-spec psuedo header.
Read more >
Working with HTTP/2 in Burp Suite - PortSwigger
Many servers now support HTTP/2. ... shows a more accurate representation of the headers and pseudo-headers that will be sent to the server....
Read more >
Translating between HTTP/1 and HTTP/2 - HTTP Toolkit
HTTP/2 moves request and response metadata into so-called 'pseudo-headers'. These are headers, but prefixed with a colon, like :path (because in HTTP/1 ...
Read more >
HTTP/2 | Node.js v19.2.0 Documentation
The node:http2 module provides an implementation of the HTTP/2 protocol. ... The :method and :path pseudo-headers are not specified within headers ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found