Having issues with H2C

I have this app that listens to both regular HTTP and gRPC requests. To do this, I listen to HTTP2 only (with prior knowledge) and configured fly.toml to use h2_backend = true.

[http_service]
  internal_port = 8080
  force_https = true
  auto_stop_machines = 'stop'
  auto_start_machines = true
  min_machines_running = 0
  processes = ['app']

  [http_service.http_options]
    h2_backend = true 

This wasn’t ideal, but it worked as long as connections started with http2 prior-knowledge. Until it didn’t… not sure when, but this recipe stopped working without any code/config changes.

The errors seem to be from the edge proxy, not hitting the app

[PU02] could not complete HTTP request to instance: hyper error: http2 error (source: stream error received: unspecific protocol error detected)

Does anyone have any hints on this? Or a similar situation? From the docs, this seems to be the proper way… terminating TLS on the edge and forward H2C…

Damn… I’m answering myself… after browsing multiple issues, looking for similar problems, I bumped into this: https://community.fly.io/t/grpc-http2-does-not-work-on-separate-port/14714

Turns out this is a .NET issue… probably upgrading to .NET 10 caused this… can’t say for sure… anyway… this is sorted.

Just a quick note that there is still an issue on Fly’s side. H2C traffic should use http scheme, not https. Hopefully someone from Fly will read this.

Hey @goncalo-oliveira

Thanks for the report! I must have broken this when I made our proxy keep the original :authority while forwarding requests.

I’ll post an update here once it’s fixed.

@goncalo-oliveira This should be fixed now.

Thanks @pavel, I appreciate it. Will revert code changes and re-test.