It seems the problem I had compiling Curl with both OpenSSL and Schannel
backends, was down to the CMake logic failing to set USE_WIN32_CRYPTO on my
build platform.

In the Curl CMakeLists.txt file, the following section of code normally
does this:

  # Check if crypto functions in wincrypt.h are actually available
  if(HAVE_WINCRYPT_H)
    check_symbol_exists(CryptAcquireContext "${CURL_INCLUDES}" USE_WINCRYPT)
  endif()
  if(USE_WINCRYPT)
    set(USE_WIN32_CRYPTO ON)
  endif()

CryptAcquireContext does exist in wincrypt.h, but on my platform its
definition appears to be constrained by the following pragma.

#pragma region Desktop Family or OneCore or Games Family
#if
WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP|WINAPI_PARTITION_PHONE_RESTRICTED
| WINAPI_PARTITION_SYSTEM | WINAPI_PARTITION_GAMES)

I was using Visual Studio 2022 Community Edition in a Windows 11
development environment VM, so am guessing this doesn't fit this
WINAPI_FAMILY_PARTITION definition.

I'm not sure if this will be a concern for you, but either way, for me the
solution is to simply pass -DUSE_WIN32_CRYTO=ON to the Cmake build process.
-- 
Unsubscribe: https://lists.haxx.se/listinfo/curl-library
Etiquette:   https://curl.se/mail/etiquette.html

Reply via email to