curl 支持https

为了支持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 参数,前提是你已经安装了openssl (建议安装高版本)

该步骤执行结束后,一定要观察仔细,是否有这行

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

结果为

Protocols: dict file ftp gopher http https imap pop3 rtsp smtp telnet tftp

这说明已经支持了https

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容