oatpp / oatpp-openssl

OpenSSL adaptor for Oat++ applications

Home Page:https://oatpp.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Link problem for openssl 1.1.1.k

bigriver73 opened this issue · comments

Firstly, for openssl 1.1.1, the SSLv23_method should be changed to TLS_method. But there is still link problem even when building the test suites in the release package:
[100%] Linking CXX executable module-tests ../src/liboatpp-openssl.a(Connection.cpp.o): In function oatpp::openssl::Connection::ConnectionContext::init()': Connection.cpp:(.text+0xc8): undefined reference to SSL_state' ../src/liboatpp-openssl.a(Connection.cpp.o): In function oatpp::openssl::Connection::ConnectionContext::initAsync()::HandshakeCoroutine::act()': Connection.cpp:(.text+0x32f): undefined reference to SSL_state' collect2: error: ld returned 1 exit status make[2]: *** [test/CMakeFiles/module-tests.dir/build.make:152: test/module-tests] Error 1 make[1]: *** [CMakeFiles/Makefile2:142: test/CMakeFiles/module-tests.dir/all] Error 2 make: *** [Makefile:146: all] Error 2
It is very strange that there is no definition of SSL_state in the openssl.

I find the root cause of this problem. In my building environment, there is another version of openssl in the directory /usr/local/include. Though the cmake detects the proper version, the /usr/local/include may be set before the /usr/include in the make file. I am not quite familiar with cmake, but I am wondering if there is any problem in the cmake file which may cause this problem.

oatpp-openssl module. Resolving dependencies...

OPENSSL_INCLUDE_DIR=/usr/include
OPENSSL_LIBRARIES=/usr/lib64/libssl.so;/usr/lib64/libcrypto.so
OPENSSL_VERSION=1.1.1k