我正在尝试在Ubuntu 11.04上安装Rails环境。当我启动命令rvm install 1.9.2 --with-openssl-dir=/usr/local
时,收到以下错误:
curl : (1) Protocol https not supported or disabled in libcurl
怎么解决这个问题?
得到了Windows的答案HERE,它说:
curl -XPUT 'http://localhost:9200/api/twittervnext/tweet'
Woops,首先尝试并且已经出错了:
curl: (1) Protocol 'http not supported or disabled in libcurl
出现此错误的原因有点愚蠢,当您使用命令的单引号时,Windows不喜欢它。所以正确的命令是:
curl –XPUT "http://localhost:9200/api/twittervnext/tweet"
我的问题是由未显示的UTF符号引起的。我从qazxsw poi复制链接并在剪贴板中获得下一个:
nginx track
问题符号是0x00000000: e2 80 8b 68 74 74 70 73 3a 2f 2f 73 6b 2e 65 65 2f 75 70 6c 6f 61 64 2f 66 69 6c 65 73 2f 45 53 ...https://sk.ee/upload/files/ES
0x00000020: 54 45 49 44 2d 53 4b 5f 32 30 31 35 2e 70 65 6d 2e 63 72 74 TEID-SK_2015.pem.crt
0xe2 0x80 0x8b
,它位于https之前。
我刚刚重新编译curl,配置选项指向openssl 1.0.2g库文件夹和include文件夹,我仍然收到此消息。当我在curl上做ldd时,它没有显示它使用ZERO WIDTH JOINER或libcrypt.so
,所以我认为这必须意味着即使libssl.so
和make
成功没有错误,但是curl没有HTTPS支持?配置和制作如下:
make install
我应该提到./configure --prefix=/local/scratch/PACKAGES/local --with-ssl=/local/scratch/PACKAGES/local/openssl/openssl-1.0.2g --includedir=/local/scratch/PACKAGES/local/include/openssl/openssl-1.0.2g
make
make test
make install
在libssl.so.1
。目前还不清楚/local/scratch/PACKAGES/local/lib
选项是应该指向那里,还是指向openssl install放置openssl.cnf文件的目录。我选择了后者。但如果它应该是前者,那么make应该会因为找不到库而导致错误。
在URL中指定协议可能会解决您的问题。
我遇到了类似的问题(使用curl php客户端时):
我通过domain.com而不是sftp://domain.com导致了这个令人困惑的错误:
在libcurl中不支持或禁用协议“http”,耗时0秒。
我遇到了这个问题,结果发现在https
之前有一个空间导致问题。 " https://"
vs "https://"
我在尝试为ruby安装rvm时遇到了同样的问题。找到解决方案:在root的downloads文件夹中解压缩curl(tar)之后。
cd /root/Downloads/curl # step-1
./configure --with-ssl # step-2
make # step-3
make install # step-4 (if not root, use sudo before command)
这在libcurl FAQ条目“Protocol xxx not supported or disabled in libcurl”中有具体提及。
为了您的荣幸,我也在这里嵌入了解释:
传递要使用的curl的URL时,它可能会响应不支持或禁用特定协议。这个错误消息的特殊表达方式是因为curl不会在内部区分是否不支持特定协议(即从未获得任何知道如何说该协议的代码)或者是否明确禁用了该协议。 curl可以构建为仅支持给定的一组协议,其余的将被禁用或不受支持。
请注意,如果您在“htpt://example.com”中传递错误拼写的协议部分,或者如果您在协议部分前面添加“http://example.com/”中的空格,则会出现此错误。
看起来已经有这么多的答案,但我遇到的问题是双引号。两者之间有区别:
“
和
"
将第一个双引号更改为第二个为我工作,下面是样本卷曲:
curl -X PUT -u xxx:xxx -T test.txt "https://test.com/test/test.txt"
用标志--with-darwinssl解决了这个问题
转到带有curl源代码的文件夹
在这里下载https://curl.haxx.se/download.html
sudo ./configure --with-darwinssl
make
make install
重新启动你的控制台,它就完成了!
就我而言,libcurl首先不支持HTTPS协议。为了找出支持哪些协议以及哪些协议不支持,我使用命令检查了curl版本:
curl --version
它提供的信息如下:curl 7.50.3 (x86_64-apple-darwin15.6.0) libcurl/7.50.3 SecureTransport zlib/1.2.5
协议:dict文件ftp ftps gopher http imap imaps ldap ldaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp功能:IPv6 Largefile NTLM NTLM_WB SSL libz UnixSockets
其中https协议恰好不受支持。
然后我重新安装curl并使用以下命令安装它(解压后):
./configure --with-darwinssl(在mac中启用ssl通信)make make test sudo make install
经过几分钟的工作,问题解决了!
然后我重新运行curl版本命令,它显示:
curl 7.50.3 (x86_64-apple-darwin15.6.0) libcurl/7.50.3 SecureTransport zlib/1.2.5
协议:dict文件ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp功能:IPv6 Largefile NTLM NTLM_WB SSL libz UnixSockets
HTTPS协议出现了!
最后,当您遇到卷曲问题时,这是一个有用的网站。 https://curl.haxx.se/docs/install.html
我只是将'http://webname...'
改为"http://webname..."
来解决它
注意报价。它应该是双("
)而不是单('
)。
在https网站上使用curl时遇到同样的错误
curl https://api.dis...
正如ganesh指出的那样,这是因为我的curl版本不是ssl启用的。回去用ssl下载版本,它工作正常。