I am beginner. I am trying to load HTTP URL using curl in my Ubuntu terminal.
The command I am using is
curl -L 'http://google.com'
But instead of getting source code. I am getting below error
curl: (56) Recv failure: Connection reset by peer
when I change the URL to https://google.com then no error is coming and perfectly working.
Why and how to make it work even for HTTP?
$ curl -L http://google.com <!doctype html><html itemscope="" ...and the same for https:$ curl -L https://google.com <!doctype html><html itemscope=""You can try and telnet to it on port 80 (telnet google.co.uk 80) and it'll hang for ages. Type^]to get out of it, and you'll see a load of HTML come back. When I do the same with HTTPS (telnet google.co.uk 443), you don't get anything back.$ telnet google.com 80 Trying 172.217.169.78... Connected to google.com. Escape character is '^]'. ^] HTTP/1.0 400 Bad Request Content-Type: text/html; charset=UTF-8 Referrer-Policy: no-referrer Content-Length: 1555$ telnet google.com 443 Trying 172.217.169.78... Connected to google.com. Escape character is '^]'. ^] FConnection closed by foreign host.