简体   繁体   中英

How to send a HTTPS 0.9 request from the command line?

I'm trying to reproduce an odd bug that we believe may be caused by our load balancers trying to check the status of our services, with requests using HTTP/0.9. The service is only configured to use HTTPS, so they are being sent as HTTP/0.9 over HTTPS.

I could use use telnet to send a HTTP/0.9 request, but we have to use HTTPS so that doesn't work. My usual go-to tool for this kind of thing is cURL, but it doesn't look like cURL supports sending 0.9 requests (for good reasons, I know).

What could I use to generate a HTTP/0.9 GET request over HTTPS?

You could use openssl. First establish the SSL connection:

$ openssl s_client -crlf -connect ip:port
CONNECTED
...
lots of output, certificate etc

And then send the request

GET /
[empty line]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM