Open ggreenway opened 4 years ago
This is a minor annoyance, and possibly a minor performance degradation. Mostly just something I noticed and thought "that's not what I wanted to have happen".
cc @PiotrSikora is this intentional?
Here's what I think happened:
Long ago, the tls_inspector was added, and at the time, it was the only filter that would set application_protocols
. So to make config less error-prone, we added auto-insertion of tls_inspector if a config was using a filter_chain_match
that looked at application_protocols
Then later, the http_inspector was added, which can also set application_protocols
. At that point, the auto-insertion of tls_inspector became incorrect in some cases. However, just removing the auto-insertion would break existing configs that depend on it.
Some options that I see:
@ggreenway yeah, that's the reason why this happens.
However, I'd argue that this behavior is still correct given pasted configuration, since it depends on the application_protocols
, which can be populated by the TLS inspector.
If you want to disable TLS inspector, then you can limit the scope of the match to a specific transport protocol (e.g. transport_protocol: envoy.transport_sockets.raw_buffer
), and TLS inspector won't be auto-injected anymore.
Oh, that's a good catch regarding transport_protocol
match. Thanks!
However, I'd argue that this behavior is still correct given pasted configuration, since it depends on the application_protocols, which can be populated by the TLS inspector.
My counter-argument is that Envoy doesn't have enough information here to know whether it is correct to do this. In many cases it is correct; in a case like the one I pasted above (where there's no TLS happening at all, either sniffing or terminating), it is incorrect.
But the workaround of making a more specific match is good enough for me; I prefer that to adding another config option at this point.
Description: When the http_inspector filter is used with a
filter_chain_match
rule usingapplication_protocols
, the tls_inspector listener_filter is automatically inserted as well.Repro steps: Run the following config:
Logs:
[2020-03-05 13:00:32.620][26037][warning][config] [source/server/listener_impl.cc:299] adding listener '0.0.0.0:80': filter chain match rules require TLS Inspector listener filter, but it isn't configured, trying to inject it (this might fail if Envoy is compiled without it)