-
Notifications
You must be signed in to change notification settings - Fork 350
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
TLS passthrough Gateway and TLSRoute to SSL-enabled PostgreSQL instance not working #4594
Comments
the only difference between TCPRoute and TLSRoute is an additional TLS Inspector filter that performs a SNI check gateway/internal/xds/translator/testdata/out/xds-ir/tls-route-passthrough.listeners.yaml Line 17 in db68027
cc @cpakulski |
I've come to understand the problem: fact is, that PostgreSQL's TLS involves an initial phase *in clear* when the client issues a STARTTLS request, then the tunnel establishes.
This, however, conflicts with Envoy-side setup, with TLS tunnel already up from its side, and SNI detection.
Sent from Outlook for Android<https://aka.ms/AAb9ysg>
…________________________________
From: Arko Dasgupta ***@***.***>
Sent: Friday, November 1, 2024 1:08:19 AM
To: envoyproxy/gateway ***@***.***>
Cc: Ferdinando Simonetti ***@***.***>; Author ***@***.***>
Subject: Re: [envoyproxy/gateway] TLS passthrough Gateway and TLSRoute to SSL-enabled PostgreSQL instance not working (Issue #4594)
the only difference between TCPRoute and TLSRoute is an additional TLS Inspector filter that performs a SNI check
https://github.com/envoyproxy/gateway/blob/db6802736680a08a210b16085af5a7bf2f124127/internal/xds/translator/testdata/out/xds-ir/tls-route-passthrough.listeners.yaml#L17
cc @cpakulski<https://github.com/cpakulski>
—
Reply to this email directly, view it on GitHub<#4594 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AFHUAS7QLV23ZHEDOQUGS4DZ6LA7HAVCNFSM6AAAAABQ6BBQDOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINJRGA2DOMBZG4>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
@ferdinandosimonetti yes, you are correct. I have not initially understood the problem you reported, but after your investigation it is clear why it does not work. |
hey @cpakulski is there an open issue in envoy proxy that we can link this issue to ? |
Not exact, but somehow related: envoyproxy/envoy#32954 |
If there would be a way to ask PostgreSQL to listen in TLS mode directly, even on a different port... then I could use several TLSRoutes with a single listener, for reaching the different PostgreSQL environments (dev, stage, prod) exposing a single IP So far, I haven't been able to understand how it could be possible, and if it could be possible. |
I could configure downstream transport socket to be TLS (not STARTTLS), so you could select route based on SNI. But you would need non-standard postgres client, as standard one uses STARTTLS. Or maybe you can construct your client to send postgres traffic in clear and that traffic is forwarded to a socket which implements TLS. In that scenario, you do not even need postgres filter and forwarding in Envoy would only need tcp_proxy. |
Description:
Instead, I received a *server closed the connection unexpectedly immediately after trying to connect
I'm working with a VPN, hence I can reach even Gateways with private IPs (my Kubernetes clusters is an Azure AKS one).
I can still reach the same PostgreSQL instance through a TCP-enabled Gateway and TCPRoute (their configurations are shown below).
Repro steps:
Below you can find my EnvoyProxy, GatewayClass, Gateway and TLSRoute
Environment:
I'm using Helm to install Envoy Gateway, the Helm Chart version is v1.1.2
My Kubernetes cluster is an Azure AKS
This other combination of TCP-enabled Gateway and TCPRoute allows me to reach the PostgreSQL instance correctly.
**I had exactly the same results (TLSRoute unreachable, server closed the connection unexpectedly) when I tried to follow the tutorial here
Logs:
Each time I try to connect through the TLS passthrough gateway and TLSRoute I see no log entries (even with debug set for log verbosity)
Here are the kubectl describe outputs for both my TLSRoute and TLS-passthrough enabled Gateway.
The text was updated successfully, but these errors were encountered: