I was looking at Most straightforward way of getting a raw, unparsed HTTPS response to make a GET request to a url over HTTPS, and receive the raw, unparsed response.
the following works:
echo 'GET / HTTP/1.1
Host: google.com
' | openssl s_client -quiet -connect google.com:443 2>/dev/null
However, I want to put the request in a text file and cat it to the command.
So I created raw-http.txt
GET / HTTP/1.0
Host: google.com
Just to be clear, there is a blank like after Host: google.com.
Now when I try:
cat raw-http.txt | openssl s_client -quiet -connect google.com:443 2>/dev/null
it just freezes for a long time then respond ^X%.
why echo is working here but cat not. what can I do about this?