下載地址:
進入源碼目錄
cd /mnt/soft-backup/SOFT/OS/linuxOS/software-linux/curl/curl-7.58.0
進入curl工程根目錄執(zhí)行命令產(chǎn)生configure配置文件:
./buidconf
編譯OpenSSL并且使用 --with-ssl參數(shù)則可以支持ssl協(xié)議
./configure --with-ssl
加上ssl參數(shù)衔彻,因為默認./configure時沒帶該參數(shù)闭树,所以導(dǎo)致編出來的curl庫不支持https,也可以指定
ssl動態(tài)庫(默認)路徑:
./configure --with-ssl=/usr/local/ssl
詳細查看編譯幫助
./configure --help
亦可使用--prefix參數(shù)指定目錄
./configure --prefix=/usr/local/libcurl/install/curl-7.34.0 --with-ssl
或者可指定ssl動態(tài)庫環(huán)境變量
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/ssl/lib
注意:防止受到Heartbleed Bug的影響辉阶,建議使用OpenSSL 1.0.1g或之后的版本蹬挺。關(guān)于此漏洞的說明可參考官方的這篇文章 heartbleed.com探遵。
確認configure信息OK后躲株,然后make && make install即可筋遭。最后切換到install目錄下可以驗證編譯好的二進制文件是否已經(jīng)支持HTTPS協(xié)議碉熄。
./curl -V
curl 7.34.0 (x86_64-unknown-linux-gnu) libcurl/7.34.0 OpenSSL/1.0.0 zlib/1.2.3
Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp smtp smtps telnet tftp
Features: IPv6 Largefile NTLM NTLM_WB SSL libz TLS-SRP