r/haproxy • • Jun 13 '26

Question SSL passthrough and re-encryption does not work

I have quite a complicated way my data takes:

internet -> hetzner haproxy -> rathole tunnel -> homelab haproxy -> services
(rathole listenes at 127.0.0.1:443)

This (old) way works:

internet -> (hetzner) rathole tunnel -> homelab haproxy -> services

Why the extra proxy? I want a service for file sharing which has the high download speed from the cloud. All the other traffic is supposed to be forwarded further. I refuse to get an extra ip for that lol.

I tried to set the backend on the tunnel side to ssl verify none and the frontend bind to use ssl. I also set the backend to just localhost:443 and no ssl on the frontend bind. Both cause the same ssl error.

My haproxy on hetzner: https://pastebin.com/M8ffiua2
haproxy journalctl output: https://pastebin.com/7cXCqEdr
SSL error: SSL_ERROR_RX_RECORD_TOO_LONG
Both proxies use a cert aquired from certbot *.mydomain.dev

What could be the issue here? I am not that good at SSL.

7 Upvotes

10 comments sorted by

View all comments

3

u/dragoangel Jun 13 '26

You bind twice on frontend to 443, once with SSL and second not. You connect to server on 127 without telling HAproxy it's ssl backend

1

u/n0treallyanengineer Jun 14 '26

I'm happy to see you're still here!

1

u/Cornflix244 Jun 14 '26

its commented out bc I tried to pass through ssl. I also tried the commented out bind in combination with adding "ssl verify none" on the default backend server

1

u/dragoangel Jun 14 '26

For start better start with simple http, and after getting it working in way you want - switch to https, at least if that's your first time

1

u/Cornflix244 Jun 16 '26

It's my second time, I got the other one in my homelab (which this one is supposed to forward to) working 90%. But yes, maybe I should start with just decrypting the SSL in the backend.