[英]How do i get cURL to use https
我在 Ubuntu 14.04.2 LTS。 cURL 已安装,但不包括 HTTPS 作为它将使用的协议。
例如:
curl https://npmjs.org/install.sh | sh
给我这个:
curl: (1) Protocol https not supported or disabled in libcurl
检查 curl -V 结果:
Protocols: dict file ftp gopher http imap pop3 rtsp smtp telnet tftp
Features: IPv6 Largefile
该列表中缺少 HTTPS...那么,如何安装支持 HTTPS 的 cURL?
哦, sudo apt-get install curl
是我首先安装它的方法。
我仍然不知道为什么使用 Aptitude 安装一个不支持 HTTPS 的版本,但是从头开始构建就成功了:
git clone https://github.com/bagder/curl.git
sudo apt-get build-dep curl
cd curl
./buildconf
./configure
make
sudo make install
现在curl -V
收益率
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp smb smbs smtp smtps telnet tftp
Features: IDN IPv6 Largefile NTLM NTLM_WB SSL libz TLS-SRP UnixSockets
哦,我首先需要这个的原因是因为 NVM 在尝试下载 Node 版本或使用 nvm ls-remote 获取可用版本列表时给了我 N/A。 这是由于 cURL 无法处理 HTTPS 请求造成的。
您的 linux 机器可能没有 libssl 库。 并且 curl 不会因此配置 OpenSSL 并且 https 将不会启用。
首先运行命令:
apt-get install libssl-dev
运行后:
./configure --with-ssl
这对我有用
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.