為了支持https,需要下載源碼包,重新編譯curl
tar zxvf curl-7.56.0.tar.gz
cd??curl-7.56.0
./configure --prefix=/usr/local/curl --with-ssl=/usr/local/openssl
#請注意,這里一定要使用 --with-ssl 參數(shù),前提是你已經(jīng)安裝了openssl (建議安裝高版本)
該步驟執(zhí)行結(jié)束后,一定要觀察仔細,是否有這行
SSL support:? ???enabled (OpenSSL)
如果你的是
SSL support:? ???no
那就是說,你的curl依舊沒有支持https
make??&&??make install
在make的時候,也許你會遇到這樣的錯誤:
`a local symbol' can not be used when making a shared object; recompile with -fPIC
libssl.a: could not read symbols: Bad value
解決辦法,請參考http://mylinux.5d6d.net/viewthread.php?tid=1013
安裝完成后,再次運行
curl安裝目錄/bin/curl -V
結(jié)果為
Protocols: dict file ftp gopher http https imap pop3 rtsp smtp telnet tftp
這說明已經(jīng)支持了https