How to build curl with the latest openssl?

So I build openssl

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

I build curl

./configure --with-ssl 
make
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...


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


sudo apt-get install libssl-dev
./configure --prefix=/usr --libdir=/usr/lib/x86_64-linux-gnu
sudo make
sudo make install

Is all I needed to build curl 7.43 on ubuntu 15.04