Re: Is there a way to tell s_client to just "send a command" and quit?
Viktor Dukhovni <[email protected]> Fri, 26 Sep 2025 18:53:47 +1000
| Newsgroups | gmane.comp.encryption.openssl.user |
|---|---|
| Message-ID | <[email protected]> |
On Fri, Sep 26, 2025 at 09:36:24AM +0200, Jochen Bern wrote:
> A truly picky one with name-based virtual hosts, on the other hand, needs
> something like
>
> ( echo -e 'GET / HTTP/1.1\r' ; echo -e 'Host: foo.bar\r' ; echo -e
> 'Connection: close\r' ; echo -e '\r' ; sleep 5 ) | openssl s_client -connect
> foo.bar:443 -servername foo.bar ...
It seems you may be unaware of the `-crlf` option of openssl-s_client(1).
host="foo.bar"
(
printf 'GET / HTTP/1.1\nHost: %s\nConnection: close\n\n' "$host"
sleep 5
) | openssl s_client -crlf -nocommands -connect "$host:443" -servername "$host" ...
--
Viktor. 🇺🇦 Слава Україні!
--
You received this message because you are subscribed to the Google Groups "openssl-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openssl-users+unsubscribe-MCmKBN63+Bmbup2nOX2J7Q@public.gmane.org
To view this discussion visit https://groups.google.com/a/openssl.org/d/msgid/openssl-users/aNZUm2ixMH8hYdvB%40chardros.imrryr.org.