Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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
like image 645
Jerry YY Rain Avatar asked Feb 10 '15 07:02

Jerry YY Rain


1 Answers

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>
like image 137
Soren Avatar answered Sep 28 '22 22:09

Soren