Skip to content

Support for cleartext HTTP/2 (h2c) #2116

@vfaronov

Description

@vfaronov
Steps to reproduce the problem:
  1. Start listening on local port 8081 like this: nc -vl 8081
  2. Start mitmproxy like this: mitmdump --http2 --reverse http://localhost:8081
  3. Use nghttp to make a request like this: nghttp -v http://localhost:8080/
  4. Port 8081 receives the following:
PRI * HTTP/2.0
:authority: localhost
host: localhost:8081

This looks like the HTTP/2 connection preface interpreted by mitmproxy (?) as an actual HTTP/1.1 request.

Any other comments? What have you tried so far?

The same happens if I use Hyper in direct mode (hyper --h2 GET http://localhost:8080/) instead of nghttp.

I would expect mitmproxy to forward nghttp’s request to port 8081 in direct cleartext HTTP/2, though cleartext HTTP/1.1 and upgrading cleartext HTTP/2 would also be understandable.

See also #2115.

System information

(this is mitmproxy master)

Mitmproxy version: 3.0.0 (release version)
Python version: 3.5.2
Platform: Linux-4.4.0-65-generic-x86_64-with-Ubuntu-16.04-xenial
SSL version: OpenSSL 1.0.2g 1 Mar 2016
Linux distro: Ubuntu 16.04 xenial

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions