21
21
namespace Envoy {
22
22
namespace {
23
23
24
- class ListenerFilterIntegrationTest : public testing ::TestWithParam<Network::Address::IpVersion>,
25
- public BaseIntegrationTest {
24
+ class TlsInspectorIntegrationTest : public testing ::TestWithParam<Network::Address::IpVersion>,
25
+ public BaseIntegrationTest {
26
26
public:
27
- ListenerFilterIntegrationTest ()
27
+ TlsInspectorIntegrationTest ()
28
28
: BaseIntegrationTest(GetParam(), ConfigHelper::baseConfig() + R"EOF(
29
29
filter_chains:
30
30
filters:
31
31
- name: envoy.filters.network.echo
32
32
)EOF" ) {}
33
33
34
- ~ListenerFilterIntegrationTest () override = default ;
34
+ ~TlsInspectorIntegrationTest () override = default ;
35
35
std::string appendMatcher (const std::string& listener_filter, bool disabled) {
36
36
if (disabled) {
37
37
return listener_filter +
@@ -49,9 +49,9 @@ class ListenerFilterIntegrationTest : public testing::TestWithParam<Network::Add
49
49
}
50
50
}
51
51
52
- void initializeWithListenerFilter (bool ssl_client, const std::string& log_format,
53
- absl::optional<bool > listener_filter_disabled = absl::nullopt,
54
- bool enable_ja3_fingerprinting = false ) {
52
+ void initializeWithTlsInspector (bool ssl_client, const std::string& log_format,
53
+ absl::optional<bool > listener_filter_disabled = absl::nullopt,
54
+ bool enable_ja3_fingerprinting = false ) {
55
55
config_helper_.renameListener (" echo" );
56
56
std::string tls_inspector_config = ConfigHelper::tlsInspectorFilter (enable_ja3_fingerprinting);
57
57
if (listener_filter_disabled.has_value ()) {
@@ -91,8 +91,8 @@ class ListenerFilterIntegrationTest : public testing::TestWithParam<Network::Add
91
91
const Ssl::ClientSslTransportOptions& ssl_options = {},
92
92
const std::string& curves_list = " " ,
93
93
bool enable_ja3_fingerprinting = false ) {
94
- initializeWithListenerFilter (ssl_client, log_format, listener_filter_disabled,
95
- enable_ja3_fingerprinting);
94
+ initializeWithTlsInspector (ssl_client, log_format, listener_filter_disabled,
95
+ enable_ja3_fingerprinting);
96
96
97
97
// Set up the SSL client.
98
98
Network::Address::InstanceConstSharedPtr address =
@@ -140,23 +140,23 @@ class ListenerFilterIntegrationTest : public testing::TestWithParam<Network::Add
140
140
};
141
141
142
142
// Each listener filter is enabled by default.
143
- TEST_P (ListenerFilterIntegrationTest , AllListenerFiltersAreEnabledByDefault) {
143
+ TEST_P (TlsInspectorIntegrationTest , AllListenerFiltersAreEnabledByDefault) {
144
144
setupConnections (/* listener_filter_disabled=*/ false , /* expect_connection_open=*/ true ,
145
145
/* ssl_client=*/ true );
146
146
client_->close (Network::ConnectionCloseType::NoFlush);
147
147
EXPECT_THAT (waitForAccessLog (listener_access_log_name_), testing::Eq (" -" ));
148
148
}
149
149
150
150
// The tls_inspector is disabled. The ALPN won't be sniffed out and no filter chain is matched.
151
- TEST_P (ListenerFilterIntegrationTest , DisabledTlsInspectorFailsFilterChainFind) {
151
+ TEST_P (TlsInspectorIntegrationTest , DisabledTlsInspectorFailsFilterChainFind) {
152
152
setupConnections (/* listener_filter_disabled=*/ true , /* expect_connection_open=*/ false ,
153
153
/* ssl_client=*/ true );
154
154
EXPECT_THAT (waitForAccessLog (listener_access_log_name_),
155
155
testing::Eq (StreamInfo::ResponseCodeDetails::get ().FilterChainNotFound ));
156
156
}
157
157
158
158
// trigger the tls inspect filter timeout, and continue create new connection after timeout
159
- TEST_P (ListenerFilterIntegrationTest , ContinueOnListenerTimeout) {
159
+ TEST_P (TlsInspectorIntegrationTest , ContinueOnListenerTimeout) {
160
160
setupConnections (/* listener_filter_disabled=*/ false , /* expect_connection_open=*/ true ,
161
161
/* ssl_client=*/ false );
162
162
// The length of tls hello message is defined as `TLS_MAX_CLIENT_HELLO = 64 * 1024`
@@ -171,7 +171,7 @@ TEST_P(ListenerFilterIntegrationTest, ContinueOnListenerTimeout) {
171
171
}
172
172
173
173
// The `JA3` fingerprint is correct in the access log.
174
- TEST_P (ListenerFilterIntegrationTest , JA3FingerprintIsSet) {
174
+ TEST_P (TlsInspectorIntegrationTest , JA3FingerprintIsSet) {
175
175
// These TLS options will create a client hello message with
176
176
// `JA3` fingerprint:
177
177
// `771,49199,23-65281-10-11-35-16-13,23,0`
@@ -189,7 +189,7 @@ TEST_P(ListenerFilterIntegrationTest, JA3FingerprintIsSet) {
189
189
testing::Eq (" 71d1f47d1125ac53c3c6a4863c087cfe" ));
190
190
}
191
191
192
- INSTANTIATE_TEST_SUITE_P (IpVersions, ListenerFilterIntegrationTest ,
192
+ INSTANTIATE_TEST_SUITE_P (IpVersions, TlsInspectorIntegrationTest ,
193
193
testing::ValuesIn (TestEnvironment::getIpVersionsForTest()),
194
194
TestUtility::ipTestParamsToString);
195
195
} // namespace
0 commit comments