28

I'm trying to setup the wallet RPC for a Monero node, but when I use cURL to that port, I get this error:

curl: (1) Received HTTP/0.9 when not allowed

However, checking curl --version gives me this:

curl 7.68.0 (x86_64-pc-linux-gnu) libcurl/7.68.0 OpenSSL/1.1.1f zlib/1.2.11 brotli/1.0.7 libidn2/2.2.0 libpsl/0.21.0 (+libidn2/2.2.0) libssh/0.9.3/openssl/zlib nghttp2/1.40.0 librtmp/2.3

I thought that error would only present when cURL was compiled without nghttp2. This is an AWS environment, running 20.04.

Fibericon
  • 283
  • 1
  • 3
  • 6

6 Answers6

28
curl --http0.9

will help you out. I got that same error message after upgrading curl.

Burk
  • 281
18

It would be great to see exactly your complete curl request. HTTP/0.9 is from 1991, previous to the basic HTTP/1.0 so I think that the problem is the response from the Server.

Please try:

  1. Your curl command with the --verbose parameter so it outputs all the information.

  2. Try the same URL you attempt with curl with wget and what are the contents of the file saved. Do if from inside a new empty folder.

  3. telnet to that port and type:

    GET / HTTP/1.0<ENTER>
    <ENTER>
    

    where <ENTER> is just pressing the Enter key and see the output. Maybe you are trying to open the wrong port.

  4. Some times the problem is in the certificate. Try with the parameters:

    --ssl
    --sslv2
    --sslv3
    
  5. You can also enforce:

    --http1.1
    --http2
    

Also your organization or ISP may be using a transparent proxy which is catching the request or that is using a SSL certificate causing problems.

Carles Mateo
  • 1,647
  • 7
  • 12
1
curl --http2-prior-knowledge 'your_host'

may help if you are trying to request an HTTP/2 webserver without HTTP/1.1 upgrade (curl docs).

0

In my case I got the same error from curl and it turned out it was an ftp server...

So for the ones who came here searching for "curl: (1) Received HTTP/0.9 when not allowed" try this on a browser:

ftp://IP:PORT

Or this on a terminal:

ftp IP PORT
DimiDak
  • 741
0

In general, you can get this error with curl whenever you receive something from the server that doesn't look like an HTTP response.

For example:

# Set up a one-time "server" that returns a bad response on port 12929
echo "Not an HTTP response" | nc -l 12929 &

Try sending an HTTP request to port 12929

curl http://localhost:12929

You'll get an error like curl: (1) Received HTTP/0.9 when not allowed from curl. (Probably along with other things printed by the "server").

mwfearnley
  • 3,497
-1

You're trying to connect to an ESMTP mail server - verify this by trying telnet to the same address and port to view the ESMTP greeting.

Artur Meinild
  • 31,035