only set when option insecure is enabled (#3463)

This commit is contained in:
Victor Vazquez 2022-03-22 12:49:48 -07:00 committed by GitHub
parent ca61b8b214
commit 774077630a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -107,23 +107,23 @@ namespace Azure { namespace Perf {
{
// NOTE: perf-fm is injecting the SSL config and transport here for the client options
// If the test overrides the options/transport, this can be undone.
#if defined(BUILD_CURL_HTTP_TRANSPORT_ADAPTER)
if (m_isInsecureEnabled)
{
#if defined(BUILD_CURL_HTTP_TRANSPORT_ADAPTER)
Azure::Core::Http::CurlTransportOptions curlOptions;
curlOptions.SslVerifyPeer = false;
clientOptions.Transport.Transport
= std::make_shared<Azure::Core::Http::CurlTransport>(curlOptions);
}
#elif defined(BUILD_TRANSPORT_WINHTTP_ADAPTER)
Azure::Core::Http::WinHttpTransportOptions winHttpOptions;
winHttpOptions.IgnoreUnknownServerCert = true;
clientOptions.Transport.Transport
= std::make_shared<Azure::Core::Http::WinHttpTransport>(winHttpOptions);
Azure::Core::Http::WinHttpTransportOptions winHttpOptions;
winHttpOptions.IgnoreUnknownServerCert = true;
clientOptions.Transport.Transport
= std::make_shared<Azure::Core::Http::WinHttpTransport>(winHttpOptions);
#else
// avoid the variable not used warning
(void)clientOptions;
// avoid the variable not used warning
(void)clientOptions;
#endif
}
}
void BaseTest::ConfigureClientOptions(Azure::Core::_internal::ClientOptions& clientOptions)