Skip to content

Commit 1d7550f

Browse files
authored
Fix more http test build fails in certain configurations (microsoft#1332)
1 parent 6d0e2b7 commit 1d7550f

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

Release/tests/functional/http/client/client_construction.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ SUITE(client_construction)
173173
VERIFY_ARE_EQUAL(baseclient2.base_uri(), m_uri);
174174
}
175175

176-
#if defined(CPPREST_FORCE_HTTP_LISTENER_ASIO)
176+
#if !defined(_WIN32) && !defined(__cplusplus_winrt) || defined(CPPREST_FORCE_HTTP_CLIENT_ASIO)
177177

178178
// Verify that the callback of sslcontext is called for HTTPS
179179
TEST_FIXTURE(uri_address, ssl_context_callback_https)

Release/tests/functional/http/listener/listener_construction_tests.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -549,9 +549,13 @@ XzJTD4slrGSJrcpLt/g/Jqqdjg==
549549
listener.open().wait();
550550

551551
client::http_client_config client_config;
552+
#if !defined(_WIN32) && !defined(__cplusplus_winrt) || defined(CPPREST_FORCE_HTTP_CLIENT_ASIO)
552553
client_config.set_ssl_context_callback(
553554
[&](boost::asio::ssl::context& ctx) { ctx.add_certificate_authority(cert); });
554-
555+
#else
556+
// in this build configuration, with WinHTTP-based http_client, this test will fail unless the self-signed
557+
// cert is added to the Windows certificate store (or certificate validation is disabled in client_config)
558+
#endif
555559
client::http_client client(m_secure_uri, client_config);
556560
http_request msg(methods::GET);
557561
msg.set_request_uri(U("/"));

0 commit comments

Comments
 (0)