curl :(1) libcurl 中不支持或禁用协议 https

发布于 2024-11-26 21:41:16 字数 223 浏览 2 评论 0原文

我正在尝试在 Ubuntu 11.04 上安装 Rails 环境。当我启动命令 rvm install 1.9.2 --with-openssl-dir=/usr/local 时,收到以下错误:

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

如何解决此问题?

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/local the following error is received:

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

How can this be resolved?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(13

全部不再 2024-12-03 21:41:16

此处得到了答案视窗,
它在那里说:

curl -XPUT 'http://localhost:9200/api/twittervnext/tweet'

哎呀,第一次尝试,已经出现错误:

curl: (1) Protocol 'http not supported or disabled in libcurl

这个错误的原因有点愚蠢,Windows 不喜欢你在命令中使用单引号。所以正确的命令是:

curl –XPUT "http://localhost:9200/api/twittervnext/tweet"

Got the answer HERE for windows,
it says there that:

curl -XPUT 'http://localhost:9200/api/twittervnext/tweet'

Woops, first try and already an error:

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:

curl –XPUT "http://localhost:9200/api/twittervnext/tweet"
黑色毁心梦 2024-12-03 21:41:16

我遇到了这个问题,结果发现 https 之前有一个空格导致了问题。 " https://""https://"

I ran into this problem and turned out that there was a space before the https which was causing the problem. " https://" vs "https://"

原谅我要高飞 2024-12-03 21:41:16

看起来已经有很多答案了,但我面临的问题是双引号。
两者之间存在差异:

"

第一个双引号更改为第二个双引号对我有用,下面是示例卷曲:

curl -X PUT -u xxx:xxx -T test.txt "https://test.com/test/test.txt"

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"
惟欲睡 2024-12-03 21:41:16

我在尝试为 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)

来源

I encountered the same problem while trying to install rvm for ruby.
found the solution:
after extracting curl (tar) in downloads folder of root.

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)

source

离旧人 2024-12-03 21:41:16

就我而言,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 file ftp ftps gopher http imap imaps ldap ldaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
功能: IPv6 大文件 NTLM NTLM_WB SSL libz UnixSockets

,其中不支持 https 协议。

然后我重新安装了curl并使用以下命令安装了它(解压后):

./configure --with-darwinssl(在 Mac 中启用 ssl 通信)
制作
进行测试
须藤进行安装

经过几分钟的工作,问题解决了!

然后我重新运行curl版本命令,它显示:

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 https imap imaps ldap ldaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
特点: IPv6 大文件 NTLM NTLM_WB SSL libz UnixSockets

HTTPS 协议出现!

最后,当您遇到卷曲问题时,可以参考一个有用的网站。
https://curl.haxx.se/docs/install.html

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:

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.5
Protocols: 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

where https protocol happens to be not supported.

Then I re-installed curl and installed it using the following commands(after unpacked):

./configure --with-darwinssl (enable ssl communication in mac)
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 7.50.3 (x86_64-apple-darwin15.6.0) libcurl/7.50.3 SecureTransport zlib/1.2.5
Protocols: 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

HTTPS protocol showed up!

Finally, a useful site to refer when you run into curl problems.
https://curl.haxx.se/docs/install.html

你的往事 2024-12-03 21:41:16

我只需将 'http://webname...' 更改为 "http://webname..."

注意引号即可解决此问题。 它应该是双精度 ("),而不是单精度 (')。

I solve it just by changing 'http://webname...' to "http://webname..."

Notice the quote. It should be double (") instead of single (').

吃兔兔 2024-12-03 21:41:16

使用标志 --with-darwinssl 解决了这个问题

转到包含curl源代码的文件夹

在此处下载 https:// curl.haxx.se/download.html

sudo ./configure --with-darwinssl
make
make install

重新启动控制台即可完成!

Solved this problem with flag --with-darwinssl

Go to folder with curl source code

Download it here https://curl.haxx.se/download.html

sudo ./configure --with-darwinssl
make
make install

restart your console and it is done!

可遇━不可求 2024-12-03 21:41:16

libcurl 常见问题解答条目“libcurl 中不支持或禁用协议 xxx”。

为了让您高兴,我也将解释嵌入此处:

当传递一个 URL 给curl使用时,它可能会响应
不支持或禁用特定协议。具体方式
这个错误消息的措辞是因为curl 不做
内部区分特定协议是否不是
支持(即从未添加任何知道如何表达的代码
协议)或者它是否被明确禁用。卷曲只能构建为
支持一组给定的协议,然后其余的将被禁用
或不支持。

请注意,如果您传递拼写错误的值,也会出现此错误
协议部分如“htpt://example.com”或不太明显的部分
如果您在协议部分前面加上空格,如“
http://example.com/"。

This is specifically mentioned in the libcurl FAQ entry "Protocol xxx not supported or disabled in libcurl".

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/".

念三年u 2024-12-03 21:41:16

我的问题是由于未显示 UTF 符号引起的。我从浏览器复制链接(在我的例子中,它是 nginx 轨道)并且剪贴板中出现以下内容:

$ echo -n "​https://sk.ee/upload/files/ESTEID-SK_2015.pem.crt" | hexdump -C
00000000  e2 80 8b 68 74 74 70 73  3a 2f 2f 73 6b 2e 65 65  |...https://sk.ee|
00000010  2f 75 70 6c 6f 61 64 2f  66 69 6c 65 73 2f 45 53  |/upload/files/ES|
00000020  54 45 49 44 2d 53 4b 5f  32 30 31 35 2e 70 65 6d  |TEID-SK_2015.pem|
00000030  2e 63 72 74                                       |.crt|

问题出在序列 0xe2 0x80 0x8b 中,该序列位于 https 之前。此序列是 零宽度连接器,编码为 UTF-8。

My problem was coused by not displayed UTF symbol. I copy the link from the browser (in my case it was an nginx track) and got the following in clipboard:

$ echo -n "​https://sk.ee/upload/files/ESTEID-SK_2015.pem.crt" | hexdump -C
00000000  e2 80 8b 68 74 74 70 73  3a 2f 2f 73 6b 2e 65 65  |...https://sk.ee|
00000010  2f 75 70 6c 6f 61 64 2f  66 69 6c 65 73 2f 45 53  |/upload/files/ES|
00000020  54 45 49 44 2d 53 4b 5f  32 30 31 35 2e 70 65 6d  |TEID-SK_2015.pem|
00000030  2e 63 72 74                                       |.crt|

The problem is in the sequence 0xe2 0x80 0x8b, which precedes https. This sequence is a ZERO WIDTH JOINER encoded in UTF-8.

最初的梦 2024-12-03 21:41:16

在 https 网站上使用curl时出现相同的错误,如

curl https://api.dis...

ganesh 所指出的,这是因为我的curl版本不是'启用 SSL。返回并下载带有 ssl 的版本,效果很好。

Got the same error when using curl on https site like

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.

南城旧梦 2024-12-03 21:41:16

我刚刚重新编译了curl,配置选项指向openssl 1.0.2g 库文件夹和include 文件夹,但我仍然收到此消息。当我在curl上执行ldd时,它没有显示它使用libcrypt.solibssl.so,所以我认为这一定意味着即使makemake install 成功且没有错误,但是curl不支持HTTPS?配置和制作如下:

./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 中。目前尚不清楚 --with-ssl 选项是否应指向此处或 openssl 安装放置 openssl.cnf 文件的目录。我选择了后者。但如果应该是前者,那么 make 应该会失败,并出现找不到库的错误。

I just recompiled curl with configure options pointing to the openssl 1.0.2g library folder and include folder, and I still get this message. When I do ldd on curl, it does not show that it uses either libcrypt.so or libssl.so, so I assume this must mean that even though the make and make install succeeded without errors, nevertheless curl does not have HTTPS support? Configure and make was as follows:

./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

I should mention that libssl.so.1 is in /local/scratch/PACKAGES/local/lib. It is unclear whether the --with-ssl option should point there or to the directory where the openssl install placed the openssl.cnf file. I chose the latter. But if it were supposed to be the former, the make should have failed with an error that it couldn't find the library.

绝影如岚 2024-12-03 21:41:16

在 url 中指定协议可能会解决您的问题。

我遇到了类似的问题(在使用curl php客户端时):

我传递的是domain.com而不是sftp://domain.com,这导致了这个令人困惑的错误:

libcurl 中不支持或禁用协议“http”,耗时 0 秒。

Specifying the protocol within the url might solve your problem.

I had a similar problem (while using curl php client) :

I was passing domain.com instead of sftp://domain.com which lead to this confusing error:

Protocol "http" not supported or disabled in libcurl, took 0 seconds.

眸中客 2024-12-03 21:41:16

要构建 CURL,您首先需要 ssl 库,因此 curl 二进制文件 可以在嵌入 SSL 的情况下运行

好的,让我们开始吧:

apt install libssl-dev
wget https://curl.se/download/curl-7.52.1.zip
unzip curl-7.52.1.zip
cd curl-7.52.1
make
make install

to build CURL, you need ssl library first, so the curl binary can run with SSL embedded

Ok, let's go:

apt install libssl-dev
wget https://curl.se/download/curl-7.52.1.zip
unzip curl-7.52.1.zip
cd curl-7.52.1
make
make install
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文