openssl not responding to typed input

0

1

I'm trying to send low-level HTTP commands to our server via TLS, but when I hit the final [enter] to send the payload, I get no response. And I'm stumped as to why.

what doesn't work

Typed from a Terminal app under MacOS OR under a MINGW64 window under Windows10, I get the following:

$ openssl s_client -connect api.myhost.com:443
<lots of TLS handshake info printed...>
    Verify return code: 0 (ok)
---
GET /ping HTTP/1.1

At this point, it doesn't respond. I've also tried different line terminators, including [Shift][Enter], [CTRL]m [CTRL]j just in case it wasn't providing the correct CRLF. I also put the GET command (with an extra blank link) in a text file and doing:

$ openssl s_client -connect api.myhost.com:443 < script.txt

... but no change.

what does work

I was able to get the server to respond via HTTP and telnet:

$ telnet api.myhost.com 80
GET /ping HTTP/1.1
Accept: application/json

... and the server also responded via HTTPS using cURL

$ curl --insecure -v -X GET https://api.myhost.com/ping

Any thoughts on what's going on?

aside: why not just use cURL?

Ultimately, I need to tunnel through a proxy to the server using HTTPS, so I need to create a single socket over which I can send multiple commands. This may be possible using cURL, but I haven't learned that trick yet.

fearless_fool

Posted 2019-10-25T19:08:08.853

Reputation: 103

No answers