caddy-l4 icon indicating copy to clipboard operation
caddy-l4 copied to clipboard

handlers(l4proxy): add use_client_config to l4proxy upstream conf

Open legobeat opened this issue 1 year ago • 3 comments

The TLS client configuration for proxy upstreams considers the downstream connectino values only if configured empty.

This adds a new configuration value use_client_conf, which allows preserving this behavior despite configuring the tls field.

legobeat avatar Jun 26 '24 03:06 legobeat

Hmm, thanks -- I'm trying to understand when this would be useful though? If the server has a TLS client configured, then it is used, otherwise we transparently use the client's TLS config. How can we possibly use both?

mholt avatar Jun 27 '24 16:06 mholt

Hmm, thanks -- I'm trying to understand when this would be useful though? If the server has a TLS client configured, then it is used, otherwise we transparently use the client's TLS config. How can we possibly use both?

There might still be different connection options used in the downstream and upstream connections, though? For example, caddy-l4 user may want to override renegotiation or alpn/protocol options but still otherwise fill in from the client? E.g. we may have a currently working config with nil tls where changing anything would be perturbing the default behavior. After this change, the user can couple the new field with use_client_config: true.

Does that make sense?

One potential source of confusion I'm seeing now is that even if use_client_config is explicitly set to false, the default case will still happen and client options get filled in. Do you think it's worth the squeeze (or even desirable) to distinguish between "explicitly set false" (=> never use client options) and "not configured" (=> as today: use client options iff tls is nil)?

legobeat avatar Jul 03 '24 22:07 legobeat

For example, caddy-l4 user may want to override renegotiation or alpn/protocol options but still otherwise fill in from the client?

I think I see, so you want to use the client's connection properties but just change one or two of them.

If so, then yeah, the possibility of empty and nil values colliding will be tricky without some annoying changes... hmm.

mholt avatar Jul 04 '24 21:07 mholt