RE: Is there a way to tell s_client to just "send a command" and quit?
"'Michael Wojcik' via openssl-users" <[email protected]> Thu, 25 Sep 2025 22:42:16 +0000
| Newsgroups | gmane.comp.encryption.openssl.user |
|---|---|
| Message-ID | <SA1PR07MB976450B58CC9D1A2C8701874C01FA@SA1PR07MB9764.namprd07.prod.outlook.com> |
Mark Christian wrote: > On Thu, 2025-09-25 at 14:25 -0700, Dan Mahoney wrote: > > > > I'm writing some certificate checks that call s_client to fetch my > > cert, but openssl s_client is blocking. Is there an easy way to tell > > it "hang up as soon as negotiation settles?" > Perhaps there is a better way than piping echo to openssl. If not: > % echo | openssl s_client -connect ... Even the newline from echo is unnecessary, so you can save a few characters: $ openssl s_client -connect ... </dev/null (The </dev/null can go anywhere after the command name, actually, so "openssl </dev/null s_client ..." works too.) On Windows, use "<nul" rather than "</dev/null". In any case, the idea is to give s_client an EOF on stdin right off the bat. -- Michael Wojcik ================================ Rocket Software, Inc. and subsidiaries ■ 77 Fourth Avenue, Waltham MA 02451 ■ Main Office Toll Free Number: +1 855.577.4323 Contact Customer Support: https://my.rocketsoftware.com/RocketCommunity/RCEmailSupport Unsubscribe from Marketing Messages/Manage Your Subscription Preferences - http://www.rocketsoftware.com/manage-your-email-preferences Privacy Policy - http://www.rocketsoftware.com/company/legal/privacy-policy ================================ This communication and any attachments may contain confidential information of Rocket Software, Inc. All unauthorized use, disclosure or distribution is prohibited. If you are not the intended recipient, please notify Rocket Software immediately and destroy all copies of this communication. Thank you. -- 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/SA1PR07MB976450B58CC9D1A2C8701874C01FA%40SA1PR07MB9764.namprd07.prod.outlook.com.