netty / netty-tcnative

A fork of Apache Tomcat Native, based on finagle-native
Apache License 2.0
241 stars 179 forks source link

Building tcnative with openssl v3.0.9 throwing an error: Your version of OpenSSL is not compatible with this version of tcnative #866

Closed shamrai-dev closed 7 months ago

shamrai-dev commented 8 months ago

Hi team! I'm trying to build tomcat-native-2.0.7 following these instructions: https://tomcat.apache.org/native-doc/

I've installed openssl v3.0.9:

# /opt/openssl/bin/openssl version -a
OpenSSL 3.0.9 30 May 2023 (Library: OpenSSL 3.0.9 30 May 2023)
built on: Thu Mar 28 15:18:12 2024 UTC
platform: linux-x86_64
options:  bn(64,64)
compiler: gcc -fPIC -pthread -m64 -Wa,--noexecstack -Wall -O3 -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_PIC -DOPENSSL_BUILDING_OPENSSL -DNDEBUG
OPENSSLDIR: "/opt/openssl"
ENGINESDIR: "/opt/openssl/lib64/engines-3"
MODULESDIR: "/opt/openssl/lib64/ossl-modules"
Seeding source: os-specific
CPUINFO: OPENSSL_ia32cap=0x298220f4f8b8f15:0x0

By running the configure I'm getting an error:

/tomcat-native-2.0.7-src/native# ./configure --with-ssl=/opt/openssl/bin
...
checking for OpenSSL library... /opt/openssl/bin
using openssl from /opt/openssl/bin/lib and /opt/openssl/bin/include
checking OpenSSL library version >= 3.0.0... configure: error: Your version of OpenSSL is not compatible with this version of tcnative

I was trying to use the flag --disable-openssl-version-check and it pass configure step but then I'm getting another error:

# make
make[1]: Entering directory '/tomcat-native-2.0.7-src/native'
/bin/bash /usr/share/apr-1.0/build/libtool --no-silent --mode=compile x86_64-linux-gnu-gcc -pthread  -g -O2 -DTCNATIVE_LINUX -DHAVE_POLLSET_WAKEUP -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -g -O2 -DTCNATIVE_LINUX -DHAVE_POLLSET_WAKEUP   -I./include -I/usr/local/openjdk-17/include -I/usr/local/openjdk-17/include/linux -I/opt/openssl/bin/include  -I/usr/include/apr-1.0   -o src/ssl.lo -c src/ssl.c && touch src/ssl.lo
libtool: compile:  x86_64-linux-gnu-gcc -pthread -g -O2 -DTCNATIVE_LINUX -DHAVE_POLLSET_WAKEUP -DHAVE_CONFIG_H -DLINUX -D_REENTRANT -D_GNU_SOURCE -g -O2 -DTCNATIVE_LINUX -DHAVE_POLLSET_WAKEUP -I./include -I/usr/local/openjdk-17/include -I/usr/local/openjdk-17/include/linux -I/opt/openssl/bin/include -I/usr/include/apr-1.0 -c src/ssl.c  -fPIC -DPIC -o src/.libs/ssl.o
In file included from src/ssl.c:23:
./include/ssl_private.h:37:10: fatal error: openssl/opensslv.h: No such file or directory
   37 | #include <openssl/opensslv.h>
      |          ^~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[1]: *** [/tomcat-native-2.0.7-src/native/build/rules.mk:206: src/ssl.lo] Error 1
make[1]: Leaving directory '/tomcat-native-2.0.7-src/native'
make: *** [/tomcat-native-2.0.7-src/native/build/rules.mk:118: all-recursive] Error 1

Any suggestions?