0

I work on a project which use cURL a lot. Recently we add a new feature to allow perform SFTP calls within our API.

SFTP is disabled by default in cURL so I tried to search how to enable it. I found that answer which helped me but during the build process I got an error about SSLv3_client_method reference.

I ran :

sudo apt-get install build-essential debhelper libssh2-1-dev
sudo apt-get source libcurl3
sudo apt-get build-dep libcurl3

cd curl-*/debian

vim rules #Append "--with-libssh2"

cd ..
sudo dpkg-buildpackage
cd ..

sudo dpkg -i curl_xxxxx.deb
sudo dpkg -i libcurl3_xxxx.deb
sudo dpkg -i libcurl3-gnutls_xxxx.deb

After the update my "rules" file contains :

cd debian/build && dh_auto_configure ${CONFIGURE_ARGS}          \
    --with-ca-path=/etc/ssl/certs --with-libssh2
cd debian/build-gnutls &&  dh_auto_configure ${CONFIGURE_ARGS}  \
    --with-ca-bundle=/etc/ssl/certs/ca-certificates.crt     \
    --without-ssl --with-gnutls --with-libssh2
cd debian/build-nss && dh_auto_configure ${CONFIGURE_ARGS}      \
    --with-ca-bundle=/etc/ssl/certs/ca-certificates.crt     \
    --without-ssl --with-nss --with-libssh2

Then I got the error :

../lib/.libs/libcurl.so: undefined reference to `SSLv3_client_method'
collect2: error: ld returned 1 exit status
make[4]: *** [curl] Error 1
make[4]: Leaving directory `/home/bee4/curl-7.35.0/debian/build/src'
make[3]: *** [all] Error 2
make[3]: Leaving directory `/home/bee4/curl-7.35.0/debian/build/src'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/bee4/curl-7.35.0/debian/build'
dh_auto_build: make -j1 returned exit code 2
make[1]: *** [override_dh_auto_build] Error 2
make[1]: Leaving directory `/home/bee4/curl-7.35.0'
make: *** [build] Error 2
dpkg-buildpackage: error: debian/rules build gave error exit status 2

I use Ubuntu 14.04 on an OVH server. Maybe I'm doing something wrong ? Also is it the right way to enable SFTP support through the cURL PHP extension (first build the right cURL version then install the PHP extension).

1

I finally get this error out !

For that I needed to build a libssh2 version and build a curl version which used that. Maybe it is a problem with the bundled curl 7.35.0 in Ubuntu 14.04 (because I used a 7.46.0 during the correction).

So I downloaded a libssh2 source package then I build it :

./configure
make
make install

And I built my curl instance to use this libssh2 :

./configure --with-libssh2=/usr/local --disable-shared
make
make install

With that I have an operational instance of curl 7.46 (the lastest stable) which is also able to use the SFTP & SCP protocols.

I needed to use the --disable-shared flag to force a new compilation of different libs. Without that, the SFTP / SCP are not enabled... Maybe someone can give me some details here...

No more errors about the missing SSLv3_client_method, everything is ok !

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.