Fix more http test build fails in certain configurations (#1332)
This commit is contained in:
Родитель
6d0e2b73af
Коммит
1d7550f5d4
|
@ -173,7 +173,7 @@ SUITE(client_construction)
|
||||||
VERIFY_ARE_EQUAL(baseclient2.base_uri(), m_uri);
|
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
|
// Verify that the callback of sslcontext is called for HTTPS
|
||||||
TEST_FIXTURE(uri_address, ssl_context_callback_https)
|
TEST_FIXTURE(uri_address, ssl_context_callback_https)
|
||||||
|
|
|
@ -549,9 +549,13 @@ XzJTD4slrGSJrcpLt/g/Jqqdjg==
|
||||||
listener.open().wait();
|
listener.open().wait();
|
||||||
|
|
||||||
client::http_client_config client_config;
|
client::http_client_config client_config;
|
||||||
|
#if !defined(_WIN32) && !defined(__cplusplus_winrt) || defined(CPPREST_FORCE_HTTP_CLIENT_ASIO)
|
||||||
client_config.set_ssl_context_callback(
|
client_config.set_ssl_context_callback(
|
||||||
[&](boost::asio::ssl::context& ctx) { ctx.add_certificate_authority(cert); });
|
[&](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);
|
client::http_client client(m_secure_uri, client_config);
|
||||||
http_request msg(methods::GET);
|
http_request msg(methods::GET);
|
||||||
msg.set_request_uri(U("/"));
|
msg.set_request_uri(U("/"));
|
||||||
|
|
Загрузка…
Ссылка в новой задаче