Ruby-on-rails curl : (1) libcurl 中不支持或禁用协议 https
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6884669/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
curl : (1) Protocol https not supported or disabled in libcurl
提问by Giuseppe Di Federico
I'm trying to install the Rails environments on Ubuntu 11.04. When I launch the command rvm install 1.9.2 --with-openssl-dir=/usr/localthe following error is received:
我正在尝试在 Ubuntu 11.04 上安装 Rails 环境。当我启动命令时rvm install 1.9.2 --with-openssl-dir=/usr/local收到以下错误:
curl : (1) Protocol https not supported or disabled in libcurl
How can this be resolved?
如何解决这个问题?
回答by cnlevy
Got the answer HEREfor windows, it says there that:
在这里得到了Windows的答案,它说:
curl -XPUT 'http://localhost:9200/api/twittervnext/tweet'
Woops, first try and already an error:
Woops,首先尝试并且已经出现错误:
curl: (1) Protocol 'http not supported or disabled in libcurl
The reason for this error is kind of stupid, Windows doesn't like it when you are using single quotes for commands. So the correct command is:
这个错误的原因有点愚蠢,当你对命令使用单引号时,Windows 不喜欢它。所以正确的命令是:
curl –XPUT "http://localhost:9200/api/twittervnext/tweet"
回答by jbrahy
I ran into this problem and turned out that there was a space before the httpswhich was causing the problem. " https://"vs "https://"
我遇到了这个问题,结果发现https在导致问题的之前有一个空格。" https://"对比"https://"
回答by Pavan_Obj
Looks like there are so many Answers already but the issue I faced was with double quotes. There is a difference in between:
看起来已经有很多答案了,但我面临的问题是双引号。两者之间有区别:
“
and
和
"
Changing the 1 st double quote to the second worked for me, below is the sample curl:
将第一个双引号更改为第二个对我有用,以下是示例卷曲:
curl -X PUT -u xxx:xxx -T test.txt "https://test.com/test/test.txt"
回答by R T
I encountered the same problem while trying to install rvm for ruby. found the solution: after extracting curl (tar) in downloads folder of root.
我在尝试为 ruby 安装 rvm 时遇到了同样的问题。找到解决方案:在根目录的下载文件夹中解压 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)
回答by Daniel Stenberg
This is specifically mentioned in the libcurl FAQ entry "Protocol xxx not supported or disabled in libcurl".
这在 libcurl 常见问题条目“libcurl 中不支持或禁用协议 xxx”中特别提到。
For your pleasure I'm embedding the explanation here too:
为了您的快乐,我也在此处嵌入了解释:
When passing on a URL to curl to use, it may respond that the particular protocol is not supported or disabled. The particular way this error message is phrased is because curl doesn't make a distinction internally of whether a particular protocol is not supported (ie never got any code added that knows how to speak that protocol) or if it was explicitly disabled. curl can be built to only support a given set of protocols, and the rest would then be disabled or not supported.
Note that this error will also occur if you pass a wrongly spelled protocol part as in "htpt://example.com" or as in the less evident case if you prefix the protocol part with a space as in " http://example.com/".
当传递 URL 以使用 curl 时,它可能会响应不支持或禁用特定协议。此错误消息的特定表述方式是因为 curl 不会在内部区分是否不支持特定协议(即从未添加任何知道如何使用该协议的代码)或是否明确禁用该协议。curl 可以构建为仅支持一组给定的协议,然后将禁用或不支持其余协议。
请注意,如果您传递拼写错误的协议部分(如“htpt://example.com”)或在不太明显的情况下,如果您在协议部分前面加上一个空格(如“ http://example”),也会发生此错误 .com/”。
回答by Максим Мартынов
Solved this problem with flag --with-darwinssl
用标志 --with-darwinssl 解决了这个问题
Go to folder with curl source code
转到带有 curl 源代码的文件夹
Download it here https://curl.haxx.se/download.html
在此处下载https://curl.haxx.se/download.html
sudo ./configure --with-darwinssl
make
make install
restart your console and it is done!
重新启动您的控制台,它就完成了!
回答by someone
In my case, HTTPS protocol was not supported by libcurl at the first place. To find out which protocols are supported and which are not, I checked the curl version using command:
就我而言,libcurl 首先不支持 HTTPS 协议。为了找出支持哪些协议,哪些不支持,我使用命令检查了 curl 版本:
curl --version
It provided information as follows:
curl 7.50.3 (x86_64-apple-darwin15.6.0) libcurl/7.50.3 SecureTransport zlib/1.2.5Protocols: dict file ftp ftps gopher http imap imaps ldap ldaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: IPv6 Largefile NTLM NTLM_WB SSL libz UnixSockets
它提供的信息如下:
curl 7.50.3 (x86_64-apple-darwin15.6.0) libcurl/7.50.3 SecureTransport zlib/1.2.5协议:dict file 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
where https protocol happens to be not supported.
碰巧不支持 https 协议。
Then I re-installed curl and installed it using the following commands(after unpacked):
然后我重新安装 curl 并使用以下命令安装它(解压后):
./configure --with-darwinssl (enable ssl communication in mac) make make test sudo make install
./configure --with-darwinssl(在mac中启用ssl通信) make make test sudo make install
And after several minutes of work, Problems resolved!
经过几分钟的工作,问题解决了!
Then I re-run the curl version command, it showed:
然后我重新运行 curl version 命令,它显示:
curl 7.50.3 (x86_64-apple-darwin15.6.0) libcurl/7.50.3 SecureTransport zlib/1.2.5Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: IPv6 Largefile NTLM NTLM_WB SSL libz UnixSockets
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 大文件 NTLM NTLM_WB SSL libz UnixSockets
HTTPS protocol showed up!
HTTPS 协议出现了!
Finally, a useful site to refer when you run into curl problems.
https://curl.haxx.se/docs/install.html
最后,当您遇到 curl 问题时可以参考的有用站点。
https://curl.haxx.se/docs/install.html
回答by Aminah Nuraini
I solve it just by changing 'http://webname...'to "http://webname..."
我只是通过改变'http://webname...'来解决它"http://webname..."
Notice the quote.It should be double (") instead of single (').
注意报价。它应该是 double ( ") 而不是 single ( ')。
回答by SergA
My problem was coused by not displayed UTF symbol. I copy link from nginx trackand got the next in clipboard:
我的问题是由未显示的 UTF 符号引起的。我从nginx 轨道复制链接并在剪贴板中获得下一个:
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
Problem symbol is 0xe2 0x80 0x8bZERO WIDTH JOINER, which is precedes https.
问题符号是0xe2 0x80 0x8bZERO WIDTH JOINER,它位于 https 之前。
回答by Deepak Rao
Got the same error when using curl on https site like
在 https 站点上使用 curl 时遇到相同的错误,例如
curl https://api.dis...
as pointed out by ganesh, it was because my version of curl wasn't ssl enabled. went back and downloaded the version with ssl and it worked fine.
正如ganesh所指出的,这是因为我的 curl 版本没有启用 ssl。回去用 ssl 下载版本,它运行良好。

