Skip to content
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

compilation issue with libwebsocket with openssl version OpenSSL v3.3.1 #3209

Open
sush126 opened this issue Aug 22, 2024 · 5 comments
Open

Comments

@sush126
Copy link

sush126 commented Aug 22, 2024

Hi @lws-team , On the Windows platform, I am getting the following error. Could you please let me know if there is support for OpenSSL version 3.3.1?

Error :

9>D:\libweb4.3.2\libwebsockets\lib\tls\openssl\openssl-server.c(436,9): error C2220: the following warning is treated as an error
9>D:\libweb4.3.2\libwebsockets\lib\tls\openssl\openssl-server.c(436,9): warning C4996: 'EC_KEY_new_by_curve_name': Since OpenSSL 3.0
9>D:\libweb4.3.2\libwebsockets\lib\tls\openssl\openssl-server.c(442,2): warning C4996: 'EC_KEY_free': Since OpenSSL 3.0
9>D:\libweb4.3.2\libwebsockets\lib\tls\openssl\openssl-server.c(485,11): warning C4996: 'EVP_PKEY_get1_EC_KEY': Since OpenSSL 3.0
9>D:\libweb4.3.2\libwebsockets\lib\tls\openssl\openssl-server.c(493,2): warning C4996: 'EC_KEY_free': Since OpenSSL 3.0

@lws-team
Copy link
Member

Should be enough to use -DDISABLE_WERROR=1 at cmake

@sush126
Copy link
Author

sush126 commented Aug 22, 2024

i have tryied but same issue , please find cmakecache for reference.
i am using below command to build lws :
cmake -G "NMake Makefiles" -DLWS_WITHOUT_EXTENSIONS=OFF -DLWS_SSL_SERVER_WITH_ECDH_CERT=1
-DDISABLE_WERROR=1 -DCMAKE_BUILD_TYPE=RELEASE -DOPENSSL_ROOT_DIR="C:\\Program Files\\OpenSSL-Win64" -DCMAKE_INSTALL_PREFIX="C:\\Program Files\\libwebsockets" ..
image

@lws-team
Copy link
Member

Dunno... if you are using some GUI or whatever for msvc, you can try turning it off in there. Otherwise you'll have to look at the toolchain commandline (ie, compiler) and see what is really set there and debug from there.

@SanjayPatait
Copy link

Same with my machine as well, when tried to build lws 4.3.2 with openssl 3.0.15

D:\libwebsockets\build64>nmake

Microsoft (R) Program Maintenance Utility Version 14.41.34120.0
Copyright (C) Microsoft Corporation.  All rights reserved.

[  0%] Built target GENHDR
[  1%] Building C object lib/CMakeFiles/websockets.dir/tls/openssl/openssl-server.c.obj
openssl-server.c
D:\libwebsockets\lib\tls\openssl\openssl-server.c(436): error C2220: the following warning is treated as an error
D:\libwebsockets\lib\tls\openssl\openssl-server.c(436): warning C4996: 'EC_KEY_new_by_curve_name': Since OpenSSL 3.0
D:\libwebsockets\lib\tls\openssl\openssl-server.c(442): warning C4996: 'EC_KEY_free': Since OpenSSL 3.0
D:\libwebsockets\lib\tls\openssl\openssl-server.c(485): warning C4996: 'EVP_PKEY_get1_EC_KEY': Since OpenSSL 3.0
D:\libwebsockets\lib\tls\openssl\openssl-server.c(493): warning C4996: 'EC_KEY_free': Since OpenSSL 3.0
NMAKE : fatal error U1077: 'C:\Strawberry\c\bin\cmake.exe -E cmake_cl_compile_depends --dep-file=CMakeFiles\websockets.dir\tls\openssl\openssl-server.c.obj.d --working-dir=D:\libwebsockets\build64\lib --filter-prefix="Note: including file: " -- C:\PROGRA~1\MICROS~3\2022\PROFES~1\VC\Tools\MSVC\1441~1.341\bin\Hostx64\x64\cl.exe @C:\Users\z002uefr\AppData\Local\Temp\nmC0BD.tmp' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.41.34120\bin\HostX64\x64\nmake.exe" -s -f lib\CMakeFiles\websockets.dir\build.make /nologo -SL                 lib\CMakeFiles\websockets.dir\build' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.41.34120\bin\HostX64\x64\nmake.exe" -s -f CMakeFiles\Makefile2 /nologo -S                  all' : return code '0x2'
Stop.

Any successful solution will be appreciated...Thanks in advance.

@SanjayPatait
Copy link

For now I am able to build it by disabling warning using Pragma:

  • Add below line in 'openssl-server.c' file before line 436 to disable the warning
    • #pragma warning(disable:4996)
  • Add below line after line 493 to enable warning
    • #pragma warning(default:4996)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants