未验证 提交 1d7550f5 编写于 作者: G Gareth Sylvester-Bradley 提交者: GitHub

Fix more http test build fails in certain configurations (#1332)

上级 6d0e2b73
......@@ -173,7 +173,7 @@ SUITE(client_construction)
VERIFY_ARE_EQUAL(baseclient2.base_uri(), m_uri);
}
#if defined(CPPREST_FORCE_HTTP_LISTENER_ASIO)
#if !defined(_WIN32) && !defined(__cplusplus_winrt) || defined(CPPREST_FORCE_HTTP_CLIENT_ASIO)
// Verify that the callback of sslcontext is called for HTTPS
TEST_FIXTURE(uri_address, ssl_context_callback_https)
......
......@@ -549,9 +549,13 @@ XzJTD4slrGSJrcpLt/g/Jqqdjg==
listener.open().wait();
client::http_client_config client_config;
#if !defined(_WIN32) && !defined(__cplusplus_winrt) || defined(CPPREST_FORCE_HTTP_CLIENT_ASIO)
client_config.set_ssl_context_callback(
[&](boost::asio::ssl::context& ctx) { ctx.add_certificate_authority(cert); });
#else
// in this build configuration, with WinHTTP-based http_client, this test will fail unless the self-signed
// cert is added to the Windows certificate store (or certificate validation is disabled in client_config)
#endif
client::http_client client(m_secure_uri, client_config);
http_request msg(methods::GET);
msg.set_request_uri(U("/"));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册