Skip to content

Commit

Permalink
client_ssl_auth: Fix for filter closing connection without reason (en…
Browse files Browse the repository at this point in the history
…voyproxy#35034)

Fixes envoyproxy#34997

Signed-off-by: Arul Thileeban Sagayam <arul.thilee@gmail.com>
Signed-off-by: Fernando Cainelli <fernando.cainelli-external@getyourguide.com>
  • Loading branch information
arulthileeban authored and cainelli committed Jul 5, 2024
1 parent c6eea9b commit a322403
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ void ClientSslAuthFilter::onEvent(Network::ConnectionEvent event) {
StreamInfo::CoreResponseFlag::UpstreamProtocolError);
read_callbacks_->connection().streamInfo().setResponseCodeDetails(AuthDigestNoMatch);
config_->stats().auth_digest_no_match_.inc();
read_callbacks_->connection().close(Network::ConnectionCloseType::NoFlush);
read_callbacks_->connection().close(Network::ConnectionCloseType::NoFlush,
"auth_digest_no_match");
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,8 @@ TEST_F(ClientSslAuthFilterTest, Ssl) {
setResponseFlag(StreamInfo::CoreResponseFlag::UpstreamProtocolError));
EXPECT_CALL(filter_callbacks_.connection_.stream_info_,
setResponseCodeDetails("auth_digest_no_match"));
EXPECT_CALL(filter_callbacks_.connection_, close(Network::ConnectionCloseType::NoFlush));
EXPECT_CALL(filter_callbacks_.connection_,
close(Network::ConnectionCloseType::NoFlush, "auth_digest_no_match"));
EXPECT_EQ(Network::FilterStatus::StopIteration, instance_->onNewConnection());
filter_callbacks_.connection_.raiseEvent(Network::ConnectionEvent::Connected);
filter_callbacks_.connection_.raiseEvent(Network::ConnectionEvent::RemoteClose);
Expand Down

0 comments on commit a322403

Please sign in to comment.