File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -8366,6 +8366,19 @@ TEST(SSLClientTest, Issue2004_Online) {
83668366 EXPECT_EQ (body.substr (0 , 15 ), " <!doctype html>" );
83678367}
83688368
8369+ TEST (SSLClientTest, ErrorReportingWhenInvalid) {
8370+ // Create SSLClient with invalid cert/key to make is_valid() return false
8371+ SSLClient cli (" localhost" , 8080 , " nonexistent_cert.pem" ,
8372+ " nonexistent_key.pem" );
8373+
8374+ // is_valid() should be false due to cert loading failure
8375+ ASSERT_FALSE (cli.is_valid ());
8376+
8377+ auto res = cli.Get (" /" );
8378+ ASSERT_FALSE (res);
8379+ EXPECT_EQ (Error::SSLConnection, res.error ());
8380+ }
8381+
83698382#if 0
83708383TEST(SSLClientTest, SetInterfaceWithINET6) {
83718384 auto cli = std::make_shared<httplib::Client>("https://httpbin.org");
You can’t perform that action at this time.
0 commit comments