Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions source/common/ssl/connection_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,13 @@ Network::ConnectionImpl::PostIoAction ConnectionImpl::doHandshake() {
}

void ConnectionImpl::drainErrorQueue() {
bool saw_error = false;
while (uint64_t err = ERR_get_error()) {
if (!saw_error) {
ctx_.stats().connection_error_.inc();
saw_error = true;
}

conn_log_debug("SSL error: {}:{}:{}:{}", *this, err, ERR_lib_error_string(err),
ERR_func_error_string(err), ERR_reason_error_string(err));
UNREFERENCED_PARAMETER(err);
Expand Down
4 changes: 4 additions & 0 deletions test/common/ssl/connection_impl_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,8 @@ TEST(SslConnectionImplTest, SslError) {
}));

dispatcher.run(Event::Dispatcher::RunType::Block);

EXPECT_EQ(1UL, stats_store.counter("ssl.connection_error").value());
}

class SslReadBufferLimitTest : public testing::Test {
Expand Down Expand Up @@ -344,6 +346,8 @@ class SslReadBufferLimitTest : public testing::Test {
}

dispatcher.run(Event::Dispatcher::RunType::Block);

EXPECT_EQ(0UL, stats_store.counter("ssl.connection_error").value());
}
};

Expand Down