1

I'm trying to use openssl s_client to send a raw HTTPS request.

I type this:

$ openssl s_client -connect homebrew.herokuapp.com:443

After it finishes the SSL pleasantries, I type this:

POST http://homebrew.herokuapp.com/ HTTP/1.1

But then it closes the connection with this:

HTTP/1.1 505 HTTP Version Not Supported
Connection: close

I only get this on apps hosted on Heroku. Why?

Ram Rachum
  • 5,011
  • 6
  • 33
  • 44

1 Answers1

1

By using an absolute URL you issue a request against an HTTP proxy. To make a request against a HTTP server you need a relative URL. Also, HTTP/1.1 the use a a Host header:

 POST / HTTP/1.1
 Host: homebrew.herokuapp.com
Steffen Ullrich
  • 12,227
  • 24
  • 37
  • Sorry, I get the same error after using `POST / HTTP/1.1` as well. I get the error immediately after that line so I can't even type the second line. – Ram Rachum Sep 25 '14 at 17:09
  • 2
    Use -crlf option. Using CRLF is a must according to the RFC2616, but most servers accept a simple LF too. – Steffen Ullrich Sep 25 '14 at 17:50