5

I'm trying to build squid with openssl, but fail because make threats warnings as errors

An example: gadgets.h -> error 'void RSA_free(RSA*)' is deprecated; Since **Openssl 3.0.0** -Werror=deprecated-declarations ..

I assume that -Werror=deprecated-declarations instructs make to threat these warnings as errors. But in which file is -Werror=deprecated-declarations? How can I suppress this / avoid it?

I need squid with openssl.

france1
  • 141
  • 2
  • 12
  • does make -k fix it? prob not because it just skips it – france1 Dec 01 '21 at 18:23
  • It's not _make_ that's doing this. It's your compiler. make doesn't compile your code, so it doesn't show errors like this. Make invokes your compiler and your compiler compiles your code, and shows errors like this. There's no way we can know what's happening because you haven't shown us the compile line that generated these messages, and we can't help you fix it because you haven't shown us what part of your makefile invokes your compiler and what make variables it uses and what those variables are set to. In short, none of this is "built into" make it all depends on your makefile. – MadScientist Dec 01 '21 at 19:57
  • I thought there's a trick to ignore it.. Because deprecated doesn't mean failed – france1 Dec 02 '21 at 07:58
  • 1
    There is a GCC option to not show deprecation warnings; for example `-Wno-deprecated-declarations`. However we can't help you add it since we have no idea what your makefile looks like. – MadScientist Dec 02 '21 at 13:08
  • I can send the makefile.. Please note that the answer's solved now – france1 Dec 02 '21 at 14:24

3 Answers3

4

france1 answers correct. But maybe "step by step" commands will help to someone. I successfully built Squid 5.5 on Ubuntu 22.04 with Openssl 3.0.2.

Download openssl 1.1.1j:

cd /tmp/
wget https://github.com/openssl/openssl/archive/refs/tags/OpenSSL_1_1_1j.zip

Extract and install openssl to /usr/local/openssl_1_1_1j from source

unzip openssl-OpenSSL_1_1_1j.zip 
cd ./openssl-OpenSSL_1_1_1j/
./config --prefix=/usr/local/openssl_1_1_1j --openssldir=/usr/local/openssl_1_1_1j/ssl
make
sudo make install

Export vars

export PATH="/usr/local/openssl_1_1_1j/bin:$PATH" LD_LIBRARY_PATH="/usr/local/openssl_1_1_1j/lib:$LD_LIBRARY_PATH"
export PKG_CONFIG_PATH=/usr/local/openssl_1_1_1j/lib/pkgconfig

Download squid and compile with custom openssl:

wget http://www.squid-cache.org/Versions/v5/squid-5.5.tar.gz
tar -xzvf ./squid-5.5.tar.gz 
cd squid-5.5/
./configure --enable-ssl-crtd --with-openssl=/usr/local/openssl_1_1_1j/lib
make
sudo make install

Works!

Vsevolod Gromov
  • 471
  • 4
  • 11
2

These things are deprecated since Openssl 3.0.0. I just used Openssl 1.1.1 LTS - and it worked!

But later on I noticed that there's a squid-openssl in the ubuntu 20.10 repository.. so I installed that.

Openssl 1.1.1l: https://www.openssl.org/source/openssl-1.1.1l.tar.gz

france1
  • 141
  • 2
  • 12
2

I can compile the latest version by openssl 3. It should be fixed

check https://github.com/squid-cache/squid/commit/3db8afad158dcdaa9390d8b998239e5763ae2cf4

# squid -v
Squid Cache: Version 5.7-VCS
Service Name: squid

This binary uses OpenSSL 3.0.2 15 Mar 2022.

Ha Ha!

KLA
  • 81
  • 2