diff --git a/sdk/core/azure-core/CHANGELOG.md b/sdk/core/azure-core/CHANGELOG.md index cb2f3b030..641371ef0 100644 --- a/sdk/core/azure-core/CHANGELOG.md +++ b/sdk/core/azure-core/CHANGELOG.md @@ -11,7 +11,8 @@ ### Bugs Fixed - [2647](https://github.com/Azure/azure-sdk-for-cpp/issues/2647) Make the curl transport adapter to check the connection close header. -- [2474](https://github.com/Azure/azure-sdk-for-cpp/issues/2474) Fix compiling with MSVC and /analyze. +- [2474](https://github.com/Azure/azure-sdk-for-cpp/issues/2474) Fix compiling with MSVC and `/analyze`. +- Make WinHTTP transport adapter to NOT use SSL/TLS for unsecured HTTP connections. ### Other Changes diff --git a/sdk/core/azure-core/src/http/winhttp/win_http_transport.cpp b/sdk/core/azure-core/src/http/winhttp/win_http_transport.cpp index d96b82c3f..5c205d4a4 100644 --- a/sdk/core/azure-core/src/http/winhttp/win_http_transport.cpp +++ b/sdk/core/azure-core/src/http/winhttp/win_http_transport.cpp @@ -3,6 +3,8 @@ #include "azure/core/http/http.hpp" +#include "azure/core/internal/strings.hpp" + #if defined(BUILD_TRANSPORT_WINHTTP_ADAPTER) #include "azure/core/http/win_http_transport.hpp" #endif @@ -17,6 +19,8 @@ using namespace Azure::Core::Http; namespace { +const std::string HttpScheme = "http"; + inline std::wstring HttpMethodToWideString(HttpMethod method) { // This string should be all uppercase. @@ -289,7 +293,10 @@ void WinHttpTransport::CreateRequestHandle(std::unique_ptr<_detail::HandleManage NULL, // Use HTTP/1.1 WINHTTP_NO_REFERER, WINHTTP_DEFAULT_ACCEPT_TYPES, // No media types are accepted by the client - WINHTTP_FLAG_SECURE); // Uses secure transaction semantics (SSL/TLS) + Azure::Core::_internal::StringExtensions::LocaleInvariantCaseInsensitiveEqual( + handleManager->m_request.GetUrl().GetScheme(), HttpScheme) + ? 0 + : WINHTTP_FLAG_SECURE); // Uses secure transaction semantics (SSL/TLS) if (!handleManager->m_requestHandle) { diff --git a/sdk/identity/azure-identity/CHANGELOG.md b/sdk/identity/azure-identity/CHANGELOG.md index edfa37db9..4c61ce154 100644 --- a/sdk/identity/azure-identity/CHANGELOG.md +++ b/sdk/identity/azure-identity/CHANGELOG.md @@ -7,6 +7,7 @@ ### Breaking Changes ### Bugs Fixed +- Fixed `ManagedIdentityCredential` authentication on an Azure VM when using WinHTTP transport adapter. ### Other Changes diff --git a/sdk/identity/azure-identity/CMakeLists.txt b/sdk/identity/azure-identity/CMakeLists.txt index 2f03511c0..949a70085 100644 --- a/sdk/identity/azure-identity/CMakeLists.txt +++ b/sdk/identity/azure-identity/CMakeLists.txt @@ -20,9 +20,9 @@ include(AzureGlobalCompileOptions) az_vcpkg_integrate() if(NOT AZ_ALL_LIBRARIES) - find_package(azure-core-cpp "1.0.0" CONFIG QUIET) + find_package(azure-core-cpp "1.2.0" CONFIG QUIET) if(NOT azure-core-cpp_FOUND) - find_package(azure-core-cpp "1.0.0" REQUIRED) + find_package(azure-core-cpp "1.2.0" REQUIRED) endif() endif() diff --git a/sdk/identity/azure-identity/vcpkg/Config.cmake.in b/sdk/identity/azure-identity/vcpkg/Config.cmake.in index 3ec0c675d..f745e4e86 100644 --- a/sdk/identity/azure-identity/vcpkg/Config.cmake.in +++ b/sdk/identity/azure-identity/vcpkg/Config.cmake.in @@ -4,7 +4,7 @@ @PACKAGE_INIT@ include(CMakeFindDependencyMacro) -find_dependency(azure-core-cpp) +find_dependency(azure-core-cpp "1.2.0") include("${CMAKE_CURRENT_LIST_DIR}/azure-identity-cppTargets.cmake") diff --git a/sdk/identity/azure-identity/vcpkg/vcpkg.json b/sdk/identity/azure-identity/vcpkg/vcpkg.json index c146a5881..f58074bcb 100644 --- a/sdk/identity/azure-identity/vcpkg/vcpkg.json +++ b/sdk/identity/azure-identity/vcpkg/vcpkg.json @@ -15,7 +15,7 @@ { "name": "azure-core-cpp", "default-features": false, - "version>=": "1.0.0" + "version>=": "1.2.0" }, { "name": "vcpkg-cmake",