bool needTlsInspector(const envoy::config::listener::v3::Listener& config) {
  return std::any_of(config.filter_chains().begin(), config.filter_chains().end(),
                     [](const auto& filter_chain) {
                       const auto& matcher = filter_chain.filter_chain_match();
                       return matcher.transport_protocol() == "tls" ||
                              (matcher.transport_protocol().empty() &&
                               (!matcher.server_names().empty() ||
                                !matcher.application_protocols().empty()));
                     }) &&
         !std::any_of(
             config.listener_filters().begin(), config.listener_filters().end(),
             [](const auto& filter) {
               return filter.name() ==
                          Extensions::ListenerFilters::ListenerFilterNames::get().TlsInspector ||
                      filter.name() == "envoy.listener.tls_inspector";
             });
}
bool needTlsInspector(const envoy::config::listener::v3::Listener& config) {
  return std::any_of(config.filter_chains().begin(), config.filter_chains().end(),
                     [](const auto& filter_chain) {
                       const auto& matcher = filter_chain.filter_chain_match();
                       return matcher.transport_protocol() == "tls" ||
                              (matcher.transport_protocol().empty() &&
                               (!matcher.server_names().empty() ||
                                !matcher.application_protocols().empty()));
                     }) &&
         !std::any_of(
             config.listener_filters().begin(), config.listener_filters().end(),
             [](const auto& filter) {
               return filter.name() ==
                          Extensions::ListenerFilters::ListenerFilterNames::get().TlsInspector ||
                      filter.name() == "envoy.listener.tls_inspector";
             });
}