-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[question] Does libwebsockets compile against openssl/3.1? #2894
Comments
Could you show the output log when you execute cmake? Do you have two different versions of the OpenSSL library in your environment? |
Yes, I have different openssl versions built locally, in Conan packages. Everything is exactly the same, but with different openssl version.
Building against openssl/1.1.1w (success)``` -- Using Conan toolchain: C:/Users/memsharded/.conan2/p/b/libwe3ea0ad5fe5b19/b/build/generators/conan_toolchain.cmake -- Conan toolchain: Setting BUILD_SHARED_LIBS = OFF -- Selecting Windows SDK version 10.0.20348.0 to target Windows 10.0.19045. -- The C compiler identification is MSVC 19.38.33130.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.38.33130/bin/Hostx64/x64/cl.exe - skipped -- Detecting C compile features -- Detecting C compile features - done -- Compiled with LWS_WITH_DIR and LWS_WITH_LEJP_CONF SMD requires pthreads -- Found Git: C:/ws/cmder/vendor/git-for-windows/cmd/git.exe (found version "2.34.0.windows.1") fatal: not a git repository (or any of the parent directories): .git Git commit hash: -- CMAKE_TOOLCHAIN_FILE='C:/Users/memsharded/.conan2/p/b/libwe3ea0ad5fe5b19/b/build/generators/conan_toolchain.cmake' -- Performing Test LWS_HAVE_inline -- Performing Test LWS_HAVE_inline - Success -- Performing Test LWS_HAVE___inline__ -- Performing Test LWS_HAVE___inline__ - Failed -- Performing Test LWS_HAVE___inline -- Performing Test LWS_HAVE___inline - Success -- Performing Test LWS_HAVE_MALLOC_TRIM -- Performing Test LWS_HAVE_MALLOC_TRIM - Failed -- Performing Test LWS_HAVE_MALLOC_USABLE_SIZE -- Performing Test LWS_HAVE_MALLOC_USABLE_SIZE - Failed -- Looking for fork -- Looking for fork - not found -- Looking for getenv -- Looking for getenv - found -- Looking for malloc -- Looking for malloc - found -- Looking for memset -- Looking for memset - found -- Looking for realloc -- Looking for realloc - found -- Looking for socket -- Looking for socket - not found -- Looking for strerror -- Looking for strerror - found -- Looking for vfork -- Looking for vfork - not found -- Looking for execvpe -- Looking for execvpe - found -- Looking for getifaddrs -- Looking for getifaddrs - not found -- Looking for snprintf -- Looking for snprintf - not found -- Looking for _snprintf -- Looking for _snprintf - not found -- Looking for _vsnprintf -- Looking for _vsnprintf - not found -- Looking for getloadavg -- Looking for getloadavg - not found -- Looking for atoll -- Looking for atoll - found -- Looking for _atoi64 -- Looking for _atoi64 - found -- Looking for _stat32i64 -- Looking for _stat32i64 - found -- Looking for clock_gettime -- Looking for clock_gettime - not found -- Looking for localtime_r -- Looking for localtime_r - not found -- Looking for gmtime_r -- Looking for gmtime_r - not found -- Looking for ctime_r -- Looking for ctime_r - not found -- Looking for getgrgid_r -- Looking for getgrgid_r - not found -- Looking for getgrnam_r -- Looking for getgrnam_r - not found -- Looking for getpwuid_r -- Looking for getpwuid_r - not found -- Looking for getpwnam_r -- Looking for getpwnam_r - not found -- Looking for timegm -- Looking for timegm - not found -- Looking for in6addr.h -- Looking for in6addr.h - found -- Looking for memory.h -- Looking for memory.h - found -- Looking for netinet/in.h -- Looking for netinet/in.h - not found -- Looking for stdint.h -- Looking for stdint.h - found -- Looking for stdlib.h -- Looking for stdlib.h - found -- Looking for strings.h -- Looking for strings.h - not found -- Looking for string.h -- Looking for string.h - found -- Looking for sys/prctl.h -- Looking for sys/prctl.h - not found -- Looking for sys/socket.h -- Looking for sys/socket.h - not found -- Looking for sys/sockio.h -- Looking for sys/sockio.h - not found -- Looking for sys/stat.h -- Looking for sys/stat.h - found -- Looking for sys/types.h -- Looking for sys/types.h - found -- Looking for unistd.h -- Looking for unistd.h - not found -- Looking for vfork.h -- Looking for vfork.h - not found -- Looking for sys/capability.h -- Looking for sys/capability.h - not found -- Looking for malloc.h -- Looking for malloc.h - found -- Looking for pthread.h -- Looking for pthread.h - not found -- Looking for inttypes.h -- Looking for inttypes.h - found -- Looking for sys/resource.h -- Looking for sys/resource.h - not found -- Performing Test LWS_HAVE_WIN32_AFUNIX_H -- Performing Test LWS_HAVE_WIN32_AFUNIX_H - Success -- Looking for cap_set_flag in cap -- Looking for cap_set_flag in cap - not found -- Looking for 3 include files stdlib.h, ..., string.h -- Looking for 3 include files stdlib.h, ..., string.h - found -- Performing Test LWS_HAS_INTPTR_T -- Performing Test LWS_HAS_INTPTR_T - Success -- Performing Test LWS_HAS_GETOPT_LONG -- Performing Test LWS_HAS_GETOPT_LONG - Failed -- Performing Test LWS_HAVE_RTA_PREF -- Performing Test LWS_HAVE_RTA_PREF - Failed -- Performing Test LWS_HAVE_SUSECONDS_T -- Performing Test LWS_HAVE_SUSECONDS_T - Failed -- Performing Test LWS_HAVE_PIPE2 -- Performing Test LWS_HAVE_PIPE2 - Failed -- Performing Test LWS_HAVE_TCP_USER_TIMEOUT -- Performing Test LWS_HAVE_TCP_USER_TIMEOUT - Failed Compiling with SSL support OpenSSL include dir: C:/Users/memsharded/.conan2/p/opens07fa59b597942/p/include OpenSSL libraries: C:/Users/memsharded/.conan2/p/opens07fa59b597942/p/lib/libssl.lib;C:/Users/memsharded/.conan2/p/opens07fa59b597942/p/lib/libcrypto.lib -- Looking for openssl/ecdh.h -- Looking for openssl/ecdh.h - not found -- Looking for SSL_CTX_set1_param -- Looking for SSL_CTX_set1_param - found -- Looking for SSL_set_info_callback -- Looking for SSL_set_info_callback - found -- Looking for X509_VERIFY_PARAM_set1_host -- Looking for X509_VERIFY_PARAM_set1_host - found -- Looking for X509_VERIFY_PARAM_set1_host -- Looking for X509_VERIFY_PARAM_set1_host - not found -- Looking for RSA_set0_key -- Looking for RSA_set0_key - found -- Looking for X509_get_key_usage -- Looking for X509_get_key_usage - found -- Looking for SSL_CTX_EVP_PKEY_new_raw_private_key -- Looking for SSL_CTX_EVP_PKEY_new_raw_private_key - not found -- Looking for SSL_CTX_get0_certificate -- Looking for SSL_CTX_get0_certificate - found -- Looking for SSL_get0_alpn_selected -- Looking for SSL_get0_alpn_selected - found -- Looking for SSL_set_alpn_protos -- Looking for SSL_set_alpn_protos - found -- Looking for EVP_aes_128_cfb8 -- Looking for EVP_aes_128_cfb8 - found -- Looking for EVP_aes_128_cfb128 -- Looking for EVP_aes_128_cfb128 - found -- Looking for EVP_aes_192_cfb8 -- Looking for EVP_aes_192_cfb8 - found -- Looking for EVP_aes_192_cfb128 -- Looking for EVP_aes_192_cfb128 - found -- Looking for EVP_aes_256_cfb8 -- Looking for EVP_aes_256_cfb8 - found -- Looking for EVP_aes_256_cfb128 -- Looking for EVP_aes_256_cfb128 - found -- Looking for EVP_aes_128_xts -- Looking for EVP_aes_128_xts - found -- Looking for EVP_aes_128_ofb -- Looking for EVP_aes_128_ofb - found -- Looking for EVP_aes_128_ecb -- Looking for EVP_aes_128_ecb - found -- Looking for EVP_aes_128_ctr -- Looking for EVP_aes_128_ctr - found -- Looking for RSA_verify_pss_mgf1 -- Looking for RSA_verify_pss_mgf1 - not found -- Looking for HMAC_CTX_new -- Looking for HMAC_CTX_new - found -- Looking for EVP_PKEY_new_raw_private_key -- Looking for EVP_PKEY_new_raw_private_key - found -- Looking for SSL_SESSION_set_time -- Looking for SSL_SESSION_set_time - found -- Looking for EC_KEY_new_by_curve_name -- Looking for EC_KEY_new_by_curve_name - found -- Performing Test LWS_HAVE_SSL_EXTRA_CHAIN_CERTS -- Performing Test LWS_HAVE_SSL_EXTRA_CHAIN_CERTS - Success -- Performing Test LWS_HAVE_EVP_MD_CTX_free -- Performing Test LWS_HAVE_EVP_MD_CTX_free - Success -- Performing Test LWS_HAVE_OPENSSL_STACK -- Performing Test LWS_HAVE_OPENSSL_STACK - Success -- Looking for ECDSA_SIG_set0 -- Looking for ECDSA_SIG_set0 - found -- Looking for BN_bn2binpad -- Looking for BN_bn2binpad - found -- Looking for EVP_aes_128_wrap -- Looking for EVP_aes_128_wrap - found -- Looking for EC_POINT_get_affine_coordinates -- Looking for EC_POINT_get_affine_coordinates - found -- Looking for TLS_client_method -- Looking for TLS_client_method - found -- Looking for TLSv1_2_client_method -- Looking for TLSv1_2_client_method - found Searching for OpenSSL executable and dlls OpenSSL executable: C:/ws/cmder/vendor/git-for-windows/mingw64/bin/openssl.exe GENCERTS = 0 DIR C:/Users/memsharded/.conan2/p/b/libwe3ea0ad5fe5b19/b/build CMP C:/Users/memsharded/.conan2/p/b/libwe3ea0ad5fe5b19/b/src/cmake -- Configuring done -- Generating done -- Build files have been written to: C:/Users/memsharded/.conan2/p/b/libwe3ea0ad5fe5b19/b/buildlibwebsockets/4.3.2: Running CMake.build() Checking Build System Building against openssl/3.1.2 (changing the conanfile.py ``requires``) (error)-- Using Conan toolchain: C:/Users/memsharded/.conan2/p/b/libwec7e7f5a13c273/b/build/generators/conan_toolchain.cmake -- Conan toolchain: Setting BUILD_SHARED_LIBS = OFF -- Selecting Windows SDK version 10.0.20348.0 to target Windows 10.0.19045. -- The C compiler identification is MSVC 19.38.33130.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.38.33130/bin/Hostx64/x64/cl.exe - skipped -- Detecting C compile features -- Detecting C compile features - done -- Compiled with LWS_WITH_DIR and LWS_WITH_LEJP_CONF SMD requires pthreads -- Found Git: C:/ws/cmder/vendor/git-for-windows/cmd/git.exe (found version "2.34.0.windows.1") fatal: not a git repository (or any of the parent directories): .git Git commit hash: -- CMAKE_TOOLCHAIN_FILE='C:/Users/memsharded/.conan2/p/b/libwec7e7f5a13c273/b/build/generators/conan_toolchain.cmake' -- Performing Test LWS_HAVE_inline -- Performing Test LWS_HAVE_inline - Success -- Performing Test LWS_HAVE___inline__ -- Performing Test LWS_HAVE___inline__ - Failed -- Performing Test LWS_HAVE___inline -- Performing Test LWS_HAVE___inline - Success -- Performing Test LWS_HAVE_MALLOC_TRIM -- Performing Test LWS_HAVE_MALLOC_TRIM - Failed -- Performing Test LWS_HAVE_MALLOC_USABLE_SIZE -- Performing Test LWS_HAVE_MALLOC_USABLE_SIZE - Failed -- Looking for fork -- Looking for fork - not found -- Looking for getenv -- Looking for getenv - found -- Looking for malloc -- Looking for malloc - found -- Looking for memset -- Looking for memset - found -- Looking for realloc -- Looking for realloc - found -- Looking for socket -- Looking for socket - not found -- Looking for strerror -- Looking for strerror - found -- Looking for vfork -- Looking for vfork - not found -- Looking for execvpe -- Looking for execvpe - found -- Looking for getifaddrs -- Looking for getifaddrs - not found -- Looking for snprintf -- Looking for snprintf - not found -- Looking for _snprintf -- Looking for _snprintf - not found -- Looking for _vsnprintf -- Looking for _vsnprintf - not found -- Looking for getloadavg -- Looking for getloadavg - not found -- Looking for atoll -- Looking for atoll - found -- Looking for _atoi64 -- Looking for _atoi64 - found -- Looking for _stat32i64 -- Looking for _stat32i64 - found -- Looking for clock_gettime -- Looking for clock_gettime - not found -- Looking for localtime_r -- Looking for localtime_r - not found -- Looking for gmtime_r -- Looking for gmtime_r - not found -- Looking for ctime_r -- Looking for ctime_r - not found -- Looking for getgrgid_r -- Looking for getgrgid_r - not found -- Looking for getgrnam_r -- Looking for getgrnam_r - not found -- Looking for getpwuid_r -- Looking for getpwuid_r - not found -- Looking for getpwnam_r -- Looking for getpwnam_r - not found -- Looking for timegm -- Looking for timegm - not found -- Looking for in6addr.h -- Looking for in6addr.h - found -- Looking for memory.h -- Looking for memory.h - found -- Looking for netinet/in.h -- Looking for netinet/in.h - not found -- Looking for stdint.h -- Looking for stdint.h - found -- Looking for stdlib.h -- Looking for stdlib.h - found -- Looking for strings.h -- Looking for strings.h - not found -- Looking for string.h -- Looking for string.h - found -- Looking for sys/prctl.h -- Looking for sys/prctl.h - not found -- Looking for sys/socket.h -- Looking for sys/socket.h - not found -- Looking for sys/sockio.h -- Looking for sys/sockio.h - not found -- Looking for sys/stat.h -- Looking for sys/stat.h - found -- Looking for sys/types.h -- Looking for sys/types.h - found -- Looking for unistd.h -- Looking for unistd.h - not found -- Looking for vfork.h -- Looking for vfork.h - not found -- Looking for sys/capability.h -- Looking for sys/capability.h - not found -- Looking for malloc.h -- Looking for malloc.h - found -- Looking for pthread.h -- Looking for pthread.h - not found -- Looking for inttypes.h -- Looking for inttypes.h - found -- Looking for sys/resource.h -- Looking for sys/resource.h - not found -- Performing Test LWS_HAVE_WIN32_AFUNIX_H -- Performing Test LWS_HAVE_WIN32_AFUNIX_H - Success -- Looking for cap_set_flag in cap -- Looking for cap_set_flag in cap - not found -- Looking for 3 include files stdlib.h, ..., string.h -- Looking for 3 include files stdlib.h, ..., string.h - found -- Performing Test LWS_HAS_INTPTR_T -- Performing Test LWS_HAS_INTPTR_T - Success -- Performing Test LWS_HAS_GETOPT_LONG -- Performing Test LWS_HAS_GETOPT_LONG - Failed -- Performing Test LWS_HAVE_RTA_PREF -- Performing Test LWS_HAVE_RTA_PREF - Failed -- Performing Test LWS_HAVE_SUSECONDS_T -- Performing Test LWS_HAVE_SUSECONDS_T - Failed -- Performing Test LWS_HAVE_PIPE2 -- Performing Test LWS_HAVE_PIPE2 - Failed -- Performing Test LWS_HAVE_TCP_USER_TIMEOUT -- Performing Test LWS_HAVE_TCP_USER_TIMEOUT - Failed Compiling with SSL support OpenSSL include dir: C:/Users/memsharded/.conan2/p/opensb53b6bbd27953/p/include OpenSSL libraries: C:/Users/memsharded/.conan2/p/opensb53b6bbd27953/p/lib/libssl.lib;C:/Users/memsharded/.conan2/p/opensb53b6bbd27953/p/lib/libcrypto.lib -- Looking for openssl/ecdh.h -- Looking for openssl/ecdh.h - not found -- Looking for SSL_CTX_set1_param -- Looking for SSL_CTX_set1_param - not found -- Looking for SSL_set_info_callback -- Looking for SSL_set_info_callback - not found -- Looking for X509_VERIFY_PARAM_set1_host -- Looking for X509_VERIFY_PARAM_set1_host - not found -- Looking for X509_VERIFY_PARAM_set1_host -- Looking for X509_VERIFY_PARAM_set1_host - not found -- Looking for RSA_set0_key -- Looking for RSA_set0_key - not found -- Looking for X509_get_key_usage -- Looking for X509_get_key_usage - not found -- Looking for SSL_CTX_EVP_PKEY_new_raw_private_key -- Looking for SSL_CTX_EVP_PKEY_new_raw_private_key - not found -- Looking for SSL_CTX_get0_certificate -- Looking for SSL_CTX_get0_certificate - not found -- Looking for SSL_get0_alpn_selected -- Looking for SSL_get0_alpn_selected - not found -- Looking for SSL_set_alpn_protos -- Looking for SSL_set_alpn_protos - not found -- Looking for EVP_aes_128_cfb8 -- Looking for EVP_aes_128_cfb8 - not found -- Looking for EVP_aes_128_cfb128 -- Looking for EVP_aes_128_cfb128 - not found -- Looking for EVP_aes_192_cfb8 -- Looking for EVP_aes_192_cfb8 - not found -- Looking for EVP_aes_192_cfb128 -- Looking for EVP_aes_192_cfb128 - not found -- Looking for EVP_aes_256_cfb8 -- Looking for EVP_aes_256_cfb8 - not found -- Looking for EVP_aes_256_cfb128 -- Looking for EVP_aes_256_cfb128 - not found -- Looking for EVP_aes_128_xts -- Looking for EVP_aes_128_xts - not found -- Looking for EVP_aes_128_ofb -- Looking for EVP_aes_128_ofb - not found -- Looking for EVP_aes_128_ecb -- Looking for EVP_aes_128_ecb - not found -- Looking for EVP_aes_128_ctr -- Looking for EVP_aes_128_ctr - not found -- Looking for RSA_verify_pss_mgf1 -- Looking for RSA_verify_pss_mgf1 - not found -- Looking for HMAC_CTX_new -- Looking for HMAC_CTX_new - not found -- Looking for EVP_PKEY_new_raw_private_key -- Looking for EVP_PKEY_new_raw_private_key - not found -- Looking for SSL_SESSION_set_time -- Looking for SSL_SESSION_set_time - not found -- Looking for EC_KEY_new_by_curve_name -- Looking for EC_KEY_new_by_curve_name - not found -- Performing Test LWS_HAVE_SSL_EXTRA_CHAIN_CERTS -- Performing Test LWS_HAVE_SSL_EXTRA_CHAIN_CERTS - Failed -- Performing Test LWS_HAVE_EVP_MD_CTX_free -- Performing Test LWS_HAVE_EVP_MD_CTX_free - Failed -- Performing Test LWS_HAVE_OPENSSL_STACK -- Performing Test LWS_HAVE_OPENSSL_STACK - Success -- Looking for ECDSA_SIG_set0 -- Looking for ECDSA_SIG_set0 - not found -- Looking for BN_bn2binpad -- Looking for BN_bn2binpad - not found -- Looking for EVP_aes_128_wrap -- Looking for EVP_aes_128_wrap - not found -- Looking for EC_POINT_get_affine_coordinates -- Looking for EC_POINT_get_affine_coordinates - not found -- Looking for TLS_client_method -- Looking for TLS_client_method - not found -- Looking for TLSv1_2_client_method -- Looking for TLSv1_2_client_method - not found Searching for OpenSSL executable and dlls OpenSSL executable: C:/ws/cmder/vendor/git-for-windows/mingw64/bin/openssl.exe GENCERTS = 0 DIR C:/Users/memsharded/.conan2/p/b/libwec7e7f5a13c273/b/build CMP C:/Users/memsharded/.conan2/p/b/libwec7e7f5a13c273/b/src/cmake -- Configuring done -- Generating done -- Build files have been written to: C:/Users/memsharded/.conan2/p/b/libwec7e7f5a13c273/b/buildlibwebsockets/4.3.2: Running CMake.build() Checking Build System C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\src\include\libwebsockets\lws-genhash.h(85,18): error C2079: 'ctx' uses undefined struct 'hmac_ctx_st' [C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\build\lib\websockets.vcxproj] openssl-x509.c C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\src\include\libwebsockets\lws-genhash.h(85,18): error C2079: 'ctx' uses undefined struct 'hmac_ctx_st' [C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\build\lib\websockets.vcxproj] C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\src\include\libwebsockets\lws-genhash.h(85,18): error C2079: 'ctx' uses undefined struct 'hmac_ctx_st' [C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\build\lib\websockets.vcxproj] C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\src\include\libwebsockets\lws-genhash.h(85,18): error C2079: 'ctx' uses undefined struct 'hmac_ctx_st' [C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\build\lib\websockets.vcxproj] C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\src\include\libwebsockets\lws-genhash.h(85,18): error C2079: 'ctx' uses undefined struct 'hmac_ctx_st' [C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\build\lib\websockets.vcxproj] C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\src\include\libwebsockets\lws-genhash.h(85,18): error C2079: 'ctx' uses undefined struct 'hmac_ctx_st' [C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\build\lib\websockets.vcxproj] C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\src\include\libwebsockets\lws-genhash.h(85,18): error C2079: 'ctx' uses undefined struct 'hmac_ctx_st' [C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\build\lib\websockets.vcxproj] C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\src\include\libwebsockets\lws-genhash.h(85,18): error C2079: 'ctx' uses undefined struct 'hmac_ctx_st' [C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\build\lib\websockets.vcxproj] C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\src\include\libwebsockets\lws-genhash.h(85,18): error C2079: 'ctx' uses undefined struct 'hmac_ctx_st' [C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\build\lib\websockets.vcxproj] openssl-server.c C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\src\include\libwebsockets\lws-genhash.h(85,18): error C2079: 'ctx' uses undefined struct 'hmac_ctx_st' [C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\build\lib\websockets.vcxproj] alloc.c lws_dll2.c C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\src\include\libwebsockets\lws-genhash.h(85,18): error C2079: 'ctx' uses undefined struct 'hmac_ctx_st' [C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\build\lib\websockets.vcxproj] lws_map.c C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\src\include\libwebsockets\lws-genhash.h(85,18): error C2079: 'ctx' uses undefined struct 'hmac_ctx_st' [C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\build\lib\websockets.vcxproj] C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\src\include\libwebsockets\lws-genhash.h(85,18): error C2079: 'ctx' uses undefined struct 'hmac_ctx_st' [C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\build\lib\websockets.vcxproj] C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\src\include\libwebsockets\lws-genhash.h(85,18): error C2079: 'ctx' uses undefined struct 'hmac_ctx_st' [C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\build\lib\websockets.vcxproj] vfs.c C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\src\include\libwebsockets\lws-genhash.h(85,18): error C2079: 'ctx' uses undefined struct 'hmac_ctx_st' [C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\build\lib\websockets.vcxproj] C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\src\include\libwebsockets\lws-genhash.h(85,18): error C2079: 'ctx' uses undefined struct 'hmac_ctx_st' [C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\build\lib\websockets.vcxproj] C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\src\lib\tls\openssl\openssl-client.c(778,3): warning C4013: 'EVP_MD_CTX_destroy' undefined; assuming extern returning int [C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\build\lib\websockets.vcxproj] C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\src\include\libwebsockets\lws-genhash.h(85,18): error C2079: 'ctx' uses undefined struct 'hmac_ctx_st' [C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\build\lib\websockets.vcxproj] file.c C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\src\include\libwebsockets\lws-genhash.h(85,18): error C2079: 'ctx' uses undefined struct 'hmac_ctx_st' [C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\build\lib\websockets.vcxproj] C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\src\include\libwebsockets\lws-genhash.h(85,18): error C2079: 'ctx' uses undefined struct 'hmac_ctx_st' [C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\build\lib\websockets.vcxproj] C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\src\include\libwebsockets\lws-genhash.h(85,18): error C2079: 'ctx' uses undefined struct 'hmac_ctx_st' [C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\build\lib\websockets.vcxproj] lwsac.c C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\src\include\libwebsockets\lws-genhash.h(85,18): error C2079: 'ctx' uses undefined struct 'hmac_ctx_st' [C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\build\lib\websockets.vcxproj] C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\src\include\libwebsockets\lws-genhash.h(85,18): error C2079: 'ctx' uses undefined struct 'hmac_ctx_st' [C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\build\lib\websockets.vcxproj] dummy-callback.c C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\src\include\libwebsockets\lws-genhash.h(85,18): error C2079: 'ctx' uses undefined struct 'hmac_ctx_st' [C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\build\lib\websockets.vcxproj] output.c close.c C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\src\include\libwebsockets\lws-genhash.h(85,18): error C2079: 'ctx' uses undefined struct 'hmac_ctx_st' [C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\build\lib\websockets.vcxproj] C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\src\include\libwebsockets\lws-genhash.h(85,18): error C2079: 'ctx' uses undefined struct 'hmac_ctx_st' [C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\build\lib\websockets.vcxproj] C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\src\include\libwebsockets\lws-genhash.h(85,18): error C2079: 'ctx' uses undefined struct 'hmac_ctx_st' [C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\build\lib\websockets.vcxproj] vhost.c C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\src\include\libwebsockets\lws-genhash.h(85,18): error C2079: 'ctx' uses undefined struct 'hmac_ctx_st' [C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\build\lib\websockets.vcxproj] C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\src\include\libwebsockets\lws-genhash.h(85,18): error C2079: 'ctx' uses undefined struct 'hmac_ctx_st' [C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\build\lib\websockets.vcxproj] adopt.c C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\src\include\libwebsockets\lws-genhash.h(85,18): error C2079: 'ctx' uses undefined struct 'hmac_ctx_st' [C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\build\lib\websockets.vcxproj] C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\src\include\libwebsockets\lws-genhash.h(85,18): error C2079: 'ctx' uses undefined struct 'hmac_ctx_st' [C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\build\lib\websockets.vcxproj] C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\src\include\libwebsockets\lws-genhash.h(85,18): error C2079: 'ctx' uses undefined struct 'hmac_ctx_st' [C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\build\lib\websockets.vcxproj] C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\src\include\libwebsockets\lws-genhash.h(85,18): error C2079: 'ctx' uses undefined struct 'hmac_ctx_st' [C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\build\lib\websockets.vcxproj] connect.c connect2.c C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\src\include\libwebsockets\lws-genhash.h(85,18): error C2079: 'ctx' uses undefined struct 'hmac_ctx_st' [C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\build\lib\websockets.vcxproj] C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\src\include\libwebsockets\lws-genhash.h(85,18): error C2079: 'ctx' uses undefined struct 'hmac_ctx_st' [C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\build\lib\websockets.vcxproj] connect4.c C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\src\include\libwebsockets\lws-genhash.h(85,18): error C2079: 'ctx' uses undefined struct 'hmac_ctx_st' [C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\build\lib\websockets.vcxproj] parsers.c C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\src\include\libwebsockets\lws-genhash.h(85,18): error C2079: 'ctx' uses undefined struct 'hmac_ctx_st' [C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\build\lib\websockets.vcxproj] C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\src\include\libwebsockets\lws-genhash.h(85,18): error C2079: 'ctx' uses undefined struct 'hmac_ctx_st' [C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\build\lib\websockets.vcxproj] C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\src\include\libwebsockets\lws-genhash.h(85,18): error C2079: 'ctx' uses undefined struct 'hmac_ctx_st' [C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\build\lib\websockets.vcxproj] server.c cookie.c C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\src\include\libwebsockets\lws-genhash.h(85,18): error C2079: 'ctx' uses undefined struct 'hmac_ctx_st' [C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\build\lib\websockets.vcxproj] lejp-conf.c C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\src\include\libwebsockets\lws-genhash.h(85,18): error C2079: 'ctx' uses undefined struct 'hmac_ctx_st' [C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\build\lib\websockets.vcxproj] C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\src\include\libwebsockets\lws-genhash.h(85,18): error C2079: 'ctx' uses undefined struct 'hmac_ctx_st' [C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\build\lib\websockets.vcxproj] http2.c C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\src\include\libwebsockets\lws-genhash.h(85,18): error C2079: 'ctx' uses undefined struct 'hmac_ctx_st' [C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\build\lib\websockets.vcxproj] C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\src\include\libwebsockets\lws-genhash.h(85,18): error C2079: 'ctx' uses undefined struct 'hmac_ctx_st' [C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\build\lib\websockets.vcxproj] client-ws.c C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\src\include\libwebsockets\lws-genhash.h(85,18): error C2079: 'ctx' uses undefined struct 'hmac_ctx_st' [C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\build\lib\websockets.vcxproj] server-ws.c C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\src\include\libwebsockets\lws-genhash.h(85,18): error C2079: 'ctx' uses undefined struct 'hmac_ctx_st' [C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\build\lib\websockets.vcxproj] ops-raw-skt.c client-http.c C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\src\include\libwebsockets\lws-genhash.h(85,18): error C2079: 'ctx' uses undefined struct 'hmac_ctx_st' [C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\build\lib\websockets.vcxproj] poll.c C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\src\include\libwebsockets\lws-genhash.h(85,18): error C2079: 'ctx' uses undefined struct 'hmac_ctx_st' [C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\build\lib\websockets.vcxproj] C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\src\include\libwebsockets\lws-genhash.h(85,18): error C2079: 'ctx' uses undefined struct 'hmac_ctx_st' [C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\build\lib\websockets.vcxproj] C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\src\include\libwebsockets\lws-genhash.h(85,18): error C2079: 'ctx' uses undefined struct 'hmac_ctx_st' [C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\build\lib\websockets.vcxproj] C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\src\include\libwebsockets\lws-genhash.h(85,18): error C2079: 'ctx' uses undefined struct 'hmac_ctx_st' [C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\build\lib\websockets.vcxproj] C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\src\include\libwebsockets\lws-genhash.h(85,18): error C2079: 'ctx' uses undefined struct 'hmac_ctx_st' [C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\build\lib\websockets.vcxproj] C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\src\include\libwebsockets\lws-genhash.h(85,18): error C2079: 'ctx' uses undefined struct 'hmac_ctx_st' [C:\Users\memsharded.conan2\p\b\libwec7e7f5a13c273\b\build\lib\websockets.vcxproj] libwebsockets/4.3.2: ERROR: |
I tested compiling libwebsockets4.3.2 with OpenSSL 3.0.12 (without conan) successfully on Windows 10 and Ubuntu 22. lws defines the macro LWS_HAVE_HMAC_CTX_new in tls/CMakeLists.txt after finding HMAC_CTX_new. I found "Looking for HMAC_CTX_new - not found" in your 3.1.2 build log, while "Looking for HMAC_CTX_new - found" in your 1.1.1w build log. This leads to the error you encountered: 'error: field 'ctx' has incomplete type'. The HMAC_CTX_new function has been deprecated since OpenSSL 3.0. However, it maintains compatibility by allowing HMAC_CTX_new to be used with setting OPENSSL_API_COMPAT to 30000 by default. Therefore, I believe the issue may be caused by the downloaded libcrypto.so of version 3.1.2. To further investigate, I reproduced the issue on Windows 10 using Conan 2 and VS2022. I performed the build using OpenSSL versions 1.1.1w and 3.0.12. When I placed the libcrypto.lib file from 1.1.1w into the OpenSSL lib folder of version 3.0.12 and recompiled, it showed "Looking for HMAC_CTX_new - found,". So I believe it is worth trying to check the downloaded OpenSSL 3.1.2 library to resolve the issue. |
@zzblydia thanks for sharing your findings. |
@lws-team it's my pleasure. exploreI wrote a demo.c file that calls the function HMAC_CTX_new and attempted to link the OpenSSL library (3.1.2) that your project download. conclusionAfter investigating, I discovered that the OpenSSL library (libcrypto) from your project download has a dependency on zlib. solutionI suggest setting 'with_zlib': 'zlib' (default_options) in conanfile.py, as the OpenSSL library(3.1.2 or 3.0.12) downloaded relies on zlib. part of compiling log:cmake -G "Visual Studio 17 2022" -DCMAKE_TOOLCHAIN_FILE="C:/Users/vmwin10/.conan2/p/b/libwefb6db7f5b2349/b/build/generators/conan_toolchain.cmake" -DCMAKE_INSTALL_PREFIX="C:/Users/vmwin10/.conan2/p/b/libwefb6db7f5b2349/p" -DCMAKE_POLICY_DEFAULT_CMP0091="NEW" "C:\Users\vmwin10.conan2\p\b\libwefb6db7f5b2349\b\src" -- Performing Test LWS_HAVE_SUSECONDS_T |
Hi, I was also having this issue with conan build. When I build openssl 3 as shared library in conan dependencies there is no problem with building LWS. But when openssl is built as static library for version 3xx , then LWS CMake cannot locate some of the new functions of openssl. Then fallbacks to old openssl definitions into compilation errors. I'm not sure if this issue is related to LWS configurations or openssl itself with static build. |
Thanks very much all for the support and help. I can confirm that the following patch builds: --- a/recipes/libwebsockets/all/conanfile.py
+++ b/recipes/libwebsockets/all/conanfile.py
@@ -109,7 +109,7 @@ class LibwebsocketsConan(ConanFile):
"fPIC": True,
"with_libuv": False,
"with_libevent": False,
- "with_zlib": False,
+ "with_zlib": "zlib",
"with_ssl": "openssl",
"with_sqlite3": False,
"with_libmount": False,
@@ -225,7 +225,7 @@ class LibwebsocketsConan(ConanFile):
if self.options.with_ssl == "openssl":
# Cannot add the [>=1.1 <4] range, as it seems openssl3 makes it fail
- self.requires("openssl/1.1.1w", transitive_headers=True)
+ self.requires("openssl/[>=1.1.1w <4]", transitive_headers=True)
elif self.options.with_ssl == "mbedtls":
self.requires("mbedtls/3.5.0")
elif self.options.with_ssl == "wolfssl": I still don't fully understand why the |
Hi @zzblydia - thanks so much for taking the time to troubleshoot. In the end, I think it has to do with These days this is typically handled automatically by CMake, when using targets - What was confusing for us was that there seems to be 3 ways to locate OpenSSL:
In most cases, CMake's legacy dependency variables ( |
Hi!
I am trying to build
libwebsockets/4.3.2
, with openssl, and exactly the same build withopenssl/1.1.1t
builds perfectly, but the same build withopenssl/3.1
is throwing several of these errors:I couldn't find information in the site or in Github, so I'd like to know if it is possible to use openssl 3.1 (note, same errors happen too with
openssl/3.0.8
), and it should work, or this is not supported. Many thanks!The text was updated successfully, but these errors were encountered: