Hi I’m using tls offloading with proxy_protocol and it’s great (I see the corrent client IP), but I still can’t get a HTTP/2 connection negotiated in any way (including HTTP2 prior knowledge).
It seems that there is no way to set TLS ALPN to be h2, it’s always http/1.1. Is there any way to tell the fly app to advertise HTTP2 support on a specific port.
# This is my networking section
[[services]]
internal_port = 8080
protocol = "tcp"
[[services.ports]]
handlers = ["tls", "proxy_proto"]
port = "443"
A .NET 6 gRPC app. Wrote my own connection middleware to process proxy protocol header. It seems that fly is only using plain text PROXY V1, so it could been a bit simpler.
Currently having issues with connection processing where Kestrel complaints about h2/h2c and http/https scheme mismatch, since it’s not aware about TLS offload (endpoint is HTTP2 only). And also it’s not possible to process both h2c and http/1.1 on same port.
Nice! For now I managed to make it work with the client preface hack. Now I’m figuring out the how to use OpenTelemetry stuff for metrics (on a isolated endpoint without proxy protocol)
@jerome et al any timeline for support for proxy_proto v2? The ClientHello contents (specifically, ALPN and SNI) sent in v2 is helpful for our use-case.
I can confirm I receive the PP2_TYPE_ALPN but no PP2_TYPE_SSL.
I guess I’ll have to change the code to assume that receiving either of these means the connection is using TLS.
My app started crashing with a 0x14 TLV (length is 0x3B = 59 bytes), see the 14 00 3b sequence in hexdump
I think when you tried adding PP2_TYPE_SSL you used the wrong TLV value in decimal, since 0x14 HEX = 20 DEC, but it’s defined as hexadecimal
It might be slightly wrong. We can take a look in about 2 hours. Until then I recommend switching the v2 option off if it’s not too much trouble. (If it’s crashing your app)
The 0x20/20 mixup seems like a bug in a crate we’re using: model.rs - source
Fairly easy to work around, unfortunately I’m off today.
However, I wanted to recommend making sure your app doesn’t crash on unrecognized TLVs - the spec may evolve later and new TLVs might be added, it’s relatively straightforward to skip over them since they’re prefixed by type+length.