curl: (1) Protocol "https" not supported or disabled in libcurl

curl是利用URL语法在命令行方式下工作的开源文件传输工具。默认安装不支持https协议。

因为https协议是加密安全的基于http的协议,需要使用openssl的静态库,所以需要支持https就必须下载openssl。

1.下载openssl网站:https://www.openssl.org/source/

选择一个版本下载,我用的centos7,下载的是第一个版本.

2.解压安装

tar -zxvf openssl-xxx.tar.gz

.configure --prefix=/usr/local/openssl  //设置安装到/usr/local/openssl路径

make  

make install

3.配置安装环境

这里非常重要,必须要加上openssl的安装路径

 ./configure --prefix=/usr/local/curl --with-ssl=/usr/local/openssl

可以看到最后显示如下,就说明可以支持SSL了 最后一行的协议支持里也有Http和Https了。


make 
make install

最后就OK啦!


猜你喜欢

转载自blog.csdn.net/yujuan110/article/details/80939311