I have the requirement that an incoming SNI is passed along to the backend.
On the backend the SNI is returned as ~ and not the actual requested SNI from HaProxy.
I’m not sure what else I can check/set. The SNI is correctly passed to the frontend just fine and it is confirmed via the specific logging I set. The sni parameter in the backend was added to test if it worked with it, but also no luck there.
Could you help me? Google/StackOverflow wasn’t really helpful sadly.
Thanks!
Do you just want to pass TCP traffic from 10.145.50.110:443 to 10.0.0.135:91? Then stop terminating SSL and just connect the two without SSL termination, that is, without ssl keyword and certificate configuration.
Then SNI is never touched because the TCP payload is unchanged.
Do you want to terminate SSL for whatever reason? Then you need reencrypt the traffic again on your backend (putting ssl keyword and verification configuration in the backend server statement).
Currently you are terminating SSL on the frontend and sending plaintext traffic to the backend on port 91. Of course plaintext traffic cannot have SNI, because it is not SSL.
Accessing the HTTP Host header is not possible when in TCP mode, you need to be in HTTP mode for that.
I want HaProxy to be serving the client with the certificate and TLS. So the termination should remain.
However I need the SNI to be passed to the backend by any means necessary.
Does your backend server 10.0.0.135 on port 91 support the binary proxy-v2 protocol? If not, you need to remove send-proxy-v2.
Is your backend server 10.0.0.135 on port 91 actually SSL enabled? If not, there is no way to send SNI.
Again, if you want to access the HTTP headers (like with req.hdr(host)) you are required to switch it all to http mode (replace mode tcp with mode http).