Skip to content

Proxy protocol support does not handle proxy payload arriving before TLS #1714

@kylepl

Description

@kylepl

I'm new to the Proxy protocol, but from what I can tell:

  • When using a TLS-passthrough for a load balancer (mine happens to be DigitalOcean), Proxy protocol is added before the TLS connection starts (since it has no way to add it just after it starts, of course, if it is passthrough).
  • The ProxyParser in uWS is called in HttpParser::getHeaders, which is after TLS parsing.

Thus, even with Proxy parsing enabled, the TLS connection fails since it is trying to parse the Proxy protocol.

I confirmed that if I hacked ssl_on_data in openssl.c, that I can see the proxy packets as expected.

So the open questions I have are:

  • Is it important to support parsing the Proxy protocol both before and after TLS, since it could come either time? My specific case is before, but it could be either in theory. The current logic is implemented to support after.
  • Open to suggestions on a reasonable approach for implementing it that I could submit as a PR. My brief investigation makes me consider sticking the parsed proxy data into loop_ssl_data, and then still exposing it similarly as today through at least HttpResponse.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions