Page MenuHomeVyOS Platform

Support SSL backends in reverse proxy
Closed, ResolvedPublicFEATURE REQUEST

Description

haproxy supports ssl backends, but this feature is not exposed in the configuration options.

vyos generates this for the backend configuration in /var/run/haproxy/haproxy.cfg

backend xyz
   balance roundrobin
   option forwardfor
   http-request set-header X-Forwarded-Port %[dst_port]
   http-request add-header X-Forwarded-Proto https if { ssl_fc }
   mode http
   server xyz 1.1.1.1:8443

But on the server line one can change it like this to support ssl

backend xyz
   balance roundrobin
   option forwardfor
   http-request set-header X-Forwarded-Port %[dst_port]
   http-request add-header X-Forwarded-Proto https if { ssl_fc }
   mode http
   server xyz 1.1.1.1:8443  ssl verify none

Which is really two additional options, one to turn on ssl, and one to not verify the certificate. The use case here is putting a valid ssl certificate using lets encrypt in front of an embedded service that only has a privately signed certificate using vyos reverse-proxy feature, and that underlying service is not easily given a real cert. But I suppose this would also be useful for path based re-redirects to ssl using backends also.

I did change /var/run/haproxy/haproxy.cfg file manually and it works fine, but obviously that is not optimal.

If someone gives a couple of pointers on where/how to perform this work I would be willing to put together an MR.

Thanks

Details

Version
-
Is it a breaking change?
Perfectly compatible
Issue type
Feature (new functionality)

Event Timeline

Viacheslav triaged this task as Wishlist priority.Jan 29 2024, 8:44 AM
Viacheslav edited projects, added VyOS 1.5 Circinus; removed VyOS 1.2 Crux.

Maybe something like

set load-balancing reverse-proxy backend <name> server <name> ssl verify <required|none>

It is also possible to pass a ca pem file to use to validate the cert. I think this could be a ca cert stored in the pki config values and exported as a PEM file for haproxy to use.

set load-balancing reverse-proxy backend <name> server <name> ssl ca-certificate <ca-name>

This would be how the server line would look with ssl required and a CA pem file.

server web2 10.0.0.6:443 ssl verify required ca-file /myca.pem

it think that we can use also something similar to what we use ocserv to generate ssl certificates:

https://docs.vyos.io/en/latest/configuration/vpn/openconnect.html#ssl-certificates

when it needs validate own certifiicate .

Viacheslav claimed this task.

The no-verify options exists

vyos@vyos# set load-balancing reverse-proxy backend bk01 ssl
Possible completions:
   ca-certificate       Certificate Authority in PKI configuration
   no-verify            Do not attempt to verify SSL certificates for backend servers

Added in the T6242

dmbaturin renamed this task from Support ssl backends on reverse-proxy to Support SSL backends in reverse proxy.Mar 25 2026, 3:03 PM
dmbaturin changed Is it a breaking change? from Unspecified (possibly destroys the router) to Perfectly compatible.
dmbaturin changed Issue type from Unspecified (please specify) to Feature (new functionality).