Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

h2c support: upgrade insecure connections to http2 #1966

Closed
raboof opened this issue Mar 27, 2018 · 8 comments
Closed

h2c support: upgrade insecure connections to http2 #1966

raboof opened this issue Mar 27, 2018 · 8 comments
Assignees
Labels
3 - in progress Someone is working on this ticket t:http2 Issues related to support HTTP2
Milestone

Comments

@raboof
Copy link
Member

raboof commented Mar 27, 2018

There are 2 mechanisms for supporting http/2 on insecure connections: with prior knowledge (#1934) or with h2c using the HTTP Upgrade mechanism (http://httpwg.org/specs/rfc7540.html#discover-http).

We're unsure how widely used h2c is and are not currently planning to implement it, but if anyone would express interest or contribute it that would be great!

@raboof raboof added help wanted Identifies issues that the core team will likely not have time to work on nice-to-have (low-prio) Tasks which make sense, however are not very high priority, feel free to help out! t:http2 Issues related to support HTTP2 labels Mar 27, 2018
@ktoso ktoso added the 1 - triaged Tickets that are safe to pick up for contributing in terms of likeliness of being accepted label Mar 27, 2018
@kun-song
Copy link
Contributor

kun-song commented Apr 8, 2018

Let me try this :)

@dsilvasc
Copy link

It looks like h2c is the transport that the grpc-java client uses when connecting to a localhost server.

If you try to use Akka HTTP as a gRPC proxy, even with akka.http.server.preview.enable-http = on in your application.conf, Akka HTTP fails to handle gRPC requests with:

[my-system-akka.actor.default-dispatcher-9] [akka.actor.ActorSystemImpl(my-system)] Illegal request, responding with status '501 Not Implemented': Unsupported HTTP method: PRI

Documentation on the PRI method:
https://http2.github.io/http2-spec/#rfc.section.11.6

This method is never used by an actual client. This method will appear to be used when an HTTP/1.1 server or intermediary attempts to parse an HTTP/2 connection preface.

@raboof
Copy link
Member Author

raboof commented Apr 15, 2018

It depends on what you set as https://grpc.io/grpc-java/javadoc/io/grpc/netty/NegotiationType.html : TLS is 'normal' HTTPS HTTP2, PLAINTEXT is #1934 and PLAINTEXT_UPGRADE is h2c.

@dsilvasc if you see that message in an Akka HTTP server it suggests the connection is 'raw' HTTP2 as supported by #1934, and not using the h2c upgrade mechanism.

@raboof
Copy link
Member Author

raboof commented May 2, 2018

@satansk did you have any luck with this so far?

@kun-song
Copy link
Contributor

kun-song commented May 2, 2018

@raboof not really, but I'm still working on this.

@raboof
Copy link
Member Author

raboof commented May 2, 2018

@satansk OK that's great! I'm also planning on having a look, so I'll share and we can compare notes.

@raboof
Copy link
Member Author

raboof commented May 3, 2018

I added some 'work in progress' in https://github.com/akka/akka-http/compare/h2c. I added a 'generic' upgrade mechanism next to the existing websocket upgrade mechanism. If this works out it would be interesting to see if we can remove the websocket-specific parts and have websockets support live on top of the generic support as well, in a binary compatible way. There's still some features and tests missing, but 'nghttp -v -u -H':method:GET' http://localhost:8080/whatever' already looks like it successfullly upgrades the connection (with some things missing, see the TODO's in that branch).

@kun-song
Copy link
Contributor

kun-song commented May 3, 2018

@raboof That's awesome. I think it's a good idea to have HTTP and websocket to use the same upgrade method, and sorry for my delayed work.

@raboof raboof removed the nice-to-have (low-prio) Tasks which make sense, however are not very high priority, feel free to help out! label May 28, 2018
@johanandren johanandren self-assigned this Jun 14, 2018
@johanandren johanandren added 3 - in progress Someone is working on this ticket and removed 1 - triaged Tickets that are safe to pick up for contributing in terms of likeliness of being accepted help wanted Identifies issues that the core team will likely not have time to work on labels Jun 14, 2018
@raboof raboof added this to the 10.1.10 milestone Sep 13, 2019
@raboof raboof closed this as completed Sep 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 - in progress Someone is working on this ticket t:http2 Issues related to support HTTP2
Projects
None yet
Development

No branches or pull requests

5 participants