Jerry YY Rain
Jerry YY Rain

Reputation: 4382

How to compile curl with latest openssl

I download curl7.40 source code, and I have already compile openssl 1.0.2 source code, Now I want to compile curl with openssl 1.0.2.

./configure --prefix=/usr/local/curl-7.40.0 --with-ssl 
--with-libssl-prefix=/usr/local/openssl-1.0.2

make && make install

After I install, I ldd curl library but still link with system default library. ldd libcurl.so linux-vdso.so.1 => (0x00007fff2db2e000) libidn.so.11 => /usr/lib/x86_64-linux-gnu/libidn.so.11 (0x00007fafb9b6e000) librtmp.so.0 => /usr/lib/x86_64-linux-gnu/librtmp.so.0 (0x00007fafb9954000) libssl.so.1.0.0 => /lib/x86_64-linux-gnu/libssl.so.1.0.0 (0x00007fafb96f5000) libcrypto.so.1.0.0 => /lib/x86_64-linux-gnu/libcrypto.so.1.0.0 (0x00007fafb931b000) ...

UPDATE
After some search, I use below command to config.

./configure --prefix=/usr/local/curl-7.40.0 --with-ssl=/usr/local/openssl-1.0.2

But when make install, it will show below error information.

../lib/.libs/libcurl.so: undefined reference to `SSLv2_client_method'
collect2: error: ld returned 1 exit status

Upvotes: 8

Views: 14080

Answers (2)

Soren
Soren

Reputation: 14688

The problem is likely with how you have build the OpenSSL library.

It is likely you have built openssl with SSLv2 disabled as some distributions have SSLv2 disable by default. Look at the ./config for your system when you are compiling OpenSSL, and find the option that controls the OPENSSL_NO_SSL2 preprocessor flag.
In order to use proper version of openssl while making from source, you can make openssl like this:

cd <path-to-openssl-dir>
./config enable-ssl2 enable-ssl3 --prefix=<path-to-openssl-install-dir>

Then, you can link your curl version properly to openssl by:

./configure --with-ssl=<path-to-openssl-install-dir>

Upvotes: 3

aitap
aitap

Reputation: 343

SSLv2_client_method() is used in lib/vtls/openssl.c, line 1575 with a check for availability of this function via autoconf. It seems to me that autoconf's AC_CHECK_FUNCS incorrectly finds your system installation of openssl which has SSLv2 enabled before #includeing your own installation of openssl-1.0.2 which doesn't have SSLv2_client_method() and thus assumes the function to be available.

Try passing CFLAGS=-I/usr/local/openssl-1.0.2/include or even "CFLAGS=-I/usr/local/openssl-1.0.2/include -DOPENSSL_NO_SSL2" as arguments to ./configure to force openssl.c to make do without the SSLv2_client_method() incorrectly assumed to be available.

Upvotes: 0

Related Questions