Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

So I build openssl

sudo make install
sudo ln -sf /usr/local/ssl/bin/openssl `which openssl`

I build curl

./configure --with-ssl 
make install

OpenSSL looks installed correctly:

openssl version
OpenSSL 1.0.1g 7 Apr 2014

however curl uses old openssl version (1.0.1f instead of 1.0.1g):

curl --version
curl 7.37.0 (x86_64-unknown-linux-gnu) libcurl/7.37.0 OpenSSL/1.0.1f zlib/1.2.8 libidn/1.28 libssh2/1.4.3 librtmp/2.3
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp scp sftp smtp smtps telnet tftp 
Features: IDN IPv6 Largefile NTLM NTLM_WB SSL libz TLS-SRP 

how to make curl use new version?

I want to try the newest versions, because I am fighting with some strange openssl/curl bug #1 #2

Edit: I also tried ./configure --with-ssl=/usr/local/ssl/include/openssl, no success

Edit2: So far I also tried:

  • sudo ./configure --with-ssl --with-libssl-prefix=/usr/local/ssl
  • ./configure --with-ssl=/usr/local/ssl
  • PKG_CONFIG_PATH=/usr/local/ssl/lib/pkgconfig ./configure
  • PKG_CONFIG_PATH=/usr/local/ssl/lib/pkgconfig ./configure --with-ssl
  • PKG_CONFIG_PATH=/usr/local/ssl/lib/pkgconfig ./configure --with-ssl=/usr/local/ssl/include/openssl

no success...

share|improve this question

2 Answers 2

You need to specify the directory where OpenSSL is installed (your symlink is neither necessary nor sufficient)

./configure --with-ssl=/usr/local/ssl

EDIT: Alternatively, you can set your PKG_CONFIG_PATH environment variable (as suggested by ./configure --help):

PKG_CONFIG_PATH=/usr/local/ssl/lib/pkgconfig ./configure

share|improve this answer
first option gives me configure: error: OpenSSL libs and/or directories were not found where specified! Please see my edit - there is no error with --with-ssl=/usr/local/ssl/include/openssl but old openssl is used. second option configures curl without HTTPS –  Peter Jun 2 '14 at 10:50
I may have gotten the directories slightly wrong, I don't have access to a Linux box right now... Basically, your manual OpenSSL installation put a file openssl.pcsomewhere, you need to point PKG_CONFIG_PATH to the directory where that file is (and make sure you have pkg-config installed, of course). –  fkraiem Jun 2 '14 at 11:06
PKG_CONFIG_PATH path is correct, I have pkg-config installed too, but somehow it doesn't work. without --with-ssl there is no HTTPS, with --with-sslit throws error configure: error: OpenSSL libs and/or directories were not found where specified! –  Peter Jun 2 '14 at 11:07
Where and how did you install ssl ? Use the correct path. –  bodhi.zazen Jun 2 '14 at 15:01
@bodhi.zazen I have install both Ubuntu package from official repositories and compiled openssl in /usr/local/ssl –  Peter Jun 5 '14 at 8:25

What I found out when was going through the same exercise is that curl simply can't work with openssl static libraries, it was always searching for dynamic, no matter what I was doing, so eventually I did three things that worked for me

Configured openssl with enable-shared: ./config enable-shared
Configured curl with openssl: ./configure --with-ssl
Used LD_LIBRARY_PATH: LD_LIBRARY_PATH=/usr/local/lib:/usr/local/ssl/lib /usr/local/bin/curl -V

The latter command with -V flag will show the openssl vesrion used by curl. I've added /usr/local/lib to LD_LIBRARY_PATH to make sure that curl uses the right libcurl version.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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