File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -645,10 +645,21 @@ TEST(HttpsToHttpRedirectTest, Redirect) {
645645
646646TEST (Server, BindAndListenSeparately) {
647647 Server svr;
648- int port = svr.bind_to_any_port (" localhost" );
648+ int port = svr.bind_to_any_port (" 0.0.0.0" );
649+ ASSERT_TRUE (svr.is_valid ());
650+ ASSERT_TRUE (port > 0 );
651+ svr.stop ();
652+ }
653+
654+ #ifdef CPPHTTPLIB_OPENSSL_SUPPORT
655+ TEST (SSLServer, BindAndListenSeparately) {
656+ SSLServer svr (SERVER_CERT_FILE, SERVER_PRIVATE_KEY_FILE, CLIENT_CA_CERT_FILE, CLIENT_CA_CERT_DIR);
657+ int port = svr.bind_to_any_port (" 0.0.0.0" );
658+ ASSERT_TRUE (svr.is_valid ());
649659 ASSERT_TRUE (port > 0 );
650660 svr.stop ();
651661}
662+ #endif
652663
653664class ServerTest : public ::testing::Test {
654665protected:
You can’t perform that action at this time.
0 commit comments