原因
curl默认安装完后是只支持http协议而不支持https协议的。
curl -V查看当前curl支持哪些协议:
[root@localhost /]# curl -V
curl 7.19.4 (x86_64-unknown-linux-gnu) libcurl/7.19.4 OpenSSL/1.0.2k zlib/1.2.11
Protocols: tftp ftp telnet dict http file ftps
可以看到并不支持https协议。所以使用curl命令访问https时就会报错:
Protocol https not supported or disabled in libcurl
解决方法
首先检测服务器安装的curl版本
curl --version 服务器安装的curl版本
rpm -qa curl 服务器安装的curl的安装包
curl -V 查看当前curl支持哪些协议
下载curl包,可以下到本地,上传至服务器,解压
wget https://curl.haxx.se/download/curl-7.87.0.tar.gz
进入cd curl-7.87.0
./configure --prefix=/usr/local/curl --with-ssl
编译、安装
make
make install