ChatGPT解决这个技术问题 Extra ChatGPT

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?

What happens if you don't use --with-openssl-dir=/usr/local (i.e. simply rvm install 1.9.2)?
the same problem, I tought that --with... was a workaround
I find it hard to believe that your curl doesn't support HTTPS. It's possible that rvm comes with its own curl, or that you didn't install curl (sudo apt-get install curl). Try curl -o "google.html" https://google.com to check if HTTPS is supported.
I'm having the same error message with RCurl.
surprised there's not an accepted answer on this one.

m
melpomene

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"

use Windows SSL-enabled cURL curl.haxx.se/latest.cgi?curl=win64-ssl-sspi instead if none of the other provided answers works for windows.
this is correct, and just to add a bit of salt, if you want to actually use the double quotes in the string you are quoting, then you need to escape them eg: curl "http://localhost:3030/messages/" -H "Content-Type: application/json" --data-binary "{ \"name\":\"Curler\", \"text\": \"Hello from the command line\" }" instead of curl "http://localhost:3030/messages/" -H "Content-Type: application/json" --data-binary '{ "name":"Curler", "text": "Hello from the command line" }'... take note of the single and unescaped double quotes on the wrong part.
@EmmanuelMahuni Thanks for the clue. I was running into the same issue while trying to CURL from bitbucket pipeline, my value includes double quotes (") (as i'm reading from json response from aws cli using jq), once after removing the double from start and end. it worked for me. Here is how i did it. new_url=$( echo $url | tr -d \" )
You just saved me SO MUCH time! Thanks!
Having the same effect with curl on macOS.
S
Suhaib Janjua

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


And I got same. I was surprised why the hell on the earth I am getting this error. :) +1 for sharing this.
Similar for me, it was a single quote because we had wrapped a default bash value with single quote although it wasn't necessary...
It's amazing that this was apparently a problem for so many people - myself included. This thing happens from time to time, but it seems kind of obscure. Ah well. Thanks
That was the issue for me. Thanks @jbrahy
Yes I got the same. By removing space it worked well for me.
P
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"

Sure thing my Man.
This one fixed my problem.
Glad it fixed :).
fixed it for me too. Had not seen this error for other curl requests with https in the past so was wondering
Good to know Anupam
R
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.

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


S
Siddharth

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


A
Aminah Nuraini

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

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


yes! This solved the issue for me, running curl in my windows command prompt. Thank you!
М
Максим Мартынов

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!


D
Daniel Stenberg

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


I don't believe this answer explains to the OP what s/he needs to do to fix the problem.
it explains what the message means, which implies that his command line wasn't enough to build libcurl with HTTPS enabled
Got bit by the space prefix. If only the error read 'Protocol "xxx" not supported or disabled in libcurl'
S
SergA

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.


D
Deepak Rao

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.


So did I, didn't see the SSL option on the download page.
t
techraf

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.


The link text itself is correct. curl cannot retrieve using https, and I don't know why.
n
ntt

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.