From 84796738fc5d1297b80c1c10795a19147104ff90 Mon Sep 17 00:00:00 2001 From: yhirose Date: Tue, 25 Nov 2025 22:22:07 -0500 Subject: [PATCH] Fix #2248 --- test/test.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/test.cc b/test/test.cc index 72e0436..76713ad 100644 --- a/test/test.cc +++ b/test/test.cc @@ -7618,7 +7618,14 @@ TEST(SNI_AutoDetectionTest, SNI_Logic) { SSLClient cli("::1", PORT); cli.enable_server_certificate_verification(false); auto res = cli.Get("/sni?expected="); - ASSERT_TRUE(res); + + // NOTE: This may fail if the server is listening on IPv4 only + // (e.g., when localhost resolves to 127.0.0.1 only) + if (res) { + EXPECT_EQ(StatusCode::OK_200, res->status); + } else { + EXPECT_EQ(Error::Connection, res.error()); + } } } }