<div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif">There have always been special commands making s_client unsuitable for this usage - for example R followed by a newline will renegotiate, and Q will quit. According to the docs these can be disabled by -quiet and -ign_eof though I've never tested that myself.</div><div class="gmail_default" style="font-family:verdana,sans-serif"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif">Cheers</div><div class="gmail_default" style="font-family:verdana,sans-serif"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif">Rich.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On 2 November 2015 at 13:37, Jakob Bohm <span dir="ltr"><<a href="mailto:jb-openssl@wisemo.com" target="_blank">jb-openssl@wisemo.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">As with most other "apps" in the openssl binary, the s_server<br>
and s_client commands are useful for multiple purposes:<br>
<br>
1. As debug tools<br>
<br>
2. As a way to do one-off operations without writing any<br>
  code.<br>
<br>
3. As back ends for small programs written in scripting<br>
  languages that cannot really call the OpenSSL library<br>
  directly.<br>
<br>
This is about the latter two uses of s_server and s_client to<br>
set up a one-off or scripted secure pipe between two machines.<br>
<br>
Unfortunately, the current (1.0.2) version of s_server will<br>
do special and problematic things when encountering some<br>
3-byte sequences (such as "\nq\n") in the data stream.<br>
<br>
It would thus be useful for s_server (and if applicable<br>
s_client) to accept the "-binary" option (already provided<br>
by the cms/smime commands), to turn off this behavior and<br>
provide a clean data pass through to/from the other end.<br>
In "-binary" mode, no byte value or sequence of byte value<br>
is special, except that explicit use of the "-crlf" option<br>
still works.<br>
<br>
Enjoy<span class="HOEnZb"><font color="#888888"><br>
<br>
Jakob<br>
-- <br>
Jakob Bohm, CIO, Partner, WiseMo A/S.  <a href="http://www.wisemo.com" rel="noreferrer" target="_blank">http://www.wisemo.com</a><br>
Transformervej 29, 2860 Søborg, Denmark.  Direct <a href="tel:%2B45%2031%2013%2016%2010" value="+4531131610" target="_blank">+45 31 13 16 10</a><br>
This public discussion message is non-binding and may contain errors.<br>
WiseMo - Remote Service Management for PCs, Phones and Embedded         <br>
<br>
_______________________________________________<br>
openssl-users mailing list<br>
To unsubscribe: <a href="https://mta.openssl.org/mailman/listinfo/openssl-users" rel="noreferrer" target="_blank">https://mta.openssl.org/mailman/listinfo/openssl-users</a><br>
</font></span></blockquote></div><br></div>