mholt / caddy-l4

Layer 4 (TCP/UDP) app for Caddy
Apache License 2.0
921 stars 69 forks source link

Support for custom certificates in TLS handler #244

Open rcm-25 opened 3 weeks ago

rcm-25 commented 3 weeks ago

It would be nice to have the option to configure custom certificates for the L4 TLS handler via the Caddyfile as it is possible in Caddy with the tls <cert_file> <key_file> directive.

I would e.g. like to use it like this (in the context of docker compose):

{
    layer4 {
        127.0.0.1:8883 {
            route {
                tls my_cert.crt my_cert.key
                proxy <docker_container>:1883
            }
        }
    }
}

This feature request emerged from the discussion in Custom certificates for TLS termination in layer4 app

mholt commented 3 weeks ago

Good idea, (sort of, lol) -- we like automation around these parts. Why do you need manually-managed certs?

rcm-25 commented 2 weeks ago

In my use case, I use Caddy with the Layer4 module as a reverse proxy in an environment that may not have online access. I would therefore like to be able to specify my own certificate here.