Apache 2.4.1 undefined reference to `SSLv2_client_method'

18,897

Solution 1

You may have built openssl with SSLv2 disabled, some distributions have that disabled (Debian, starting from 7.0 -Wheezy- is one). Looking at the source, it looks like if you define the OPENSSL_NO_SSL2 preprocessor flag, apache won't call the SSLv2_client_method() function.

Solution 2

You can also download openssl's tarbal and compile openssl with

./config shared no-ssl2

This will set the flag OPENSSL_NO_SSL2 that Jon Lin mentioned.

Solution 3

It has nothing to do with OpenSSL compilation. PHP is the culprit which is causing the error.

(Note: The is another issue with OpenSSL which might prevent u from generating openssl.so and opencrypto.so shared libraries)

Here is the overview of how it happened. PHP compiles its compilation and when "make install" is given it copies the libphp*.so to /usr/local/apache2/modules.

The source code for this error is openssl.c in /usr/local/php-5.5.3/ext/openssl

So the simple solution is to handle it in the top level Makefile. By adding CPPFLAGS = -D_REENTRANT -DTHREAD=1 -DOPENSSL_NO_SSL2

Make the above change AFTER you run the configure script. Hope this helps :)

Solution 4

Try with another Apache version. With Apache 2.2.15 the error was present but when i change to Apache 2.2.27 the "reference to `SSLv2_client_method" error simply disappeared

The compilation line is:

./configure --with-ssl --enable-ssl

That's all.

Share:
18,897
iRyanBell
Author by

iRyanBell

Updated on June 16, 2022

Comments

  • iRyanBell
    iRyanBell almost 2 years

    I was previously running apache 2.2.20 and openssl 1.0.0e. I installed openssl 1.0.1, then downloaded the tarball for apache 2.4.1 and installed apr 1.4.6 & apr-util 1.4.1 with --prefix=/usr/local. I configured apache2 with:

    sudo ./configure --prefix=/usr/local/apache2 --enable-mods-shared=all
    --enable-deflate --enable-proxy --enable-proxy-balancer --enable-proxy-http
    --enable-rewrite --enable-cache --enable-mem-cache --enable-ssl --enable-headers
    --with-mpm=worker --with-included-apr
    

    But after running sudo make I get an error:

    httpd-2.4.1/support/ab.c:2227: undefined reference to `SSLv2_client_method'
    

    What is causing this error and how do I correct it?

  • iRyanBell
    iRyanBell about 12 years
    Where would I define that flag?
  • Jon Lin
    Jon Lin about 12 years
    I can't remember what the proper way to do it is, but you could just put a #define OPENSSL_NO_SSL2 or something at the top of the ab.c file.
  • Richie Frame
    Richie Frame about 6 years
    this only works if the patch has been applied for #54736, alternatively you can comment out the sections in the source code