Hello Monks,

I'm having an issue that has cost me hours of testing. Please help. What I am trying to do; Connect raw to a site using openssl like this: openssl s_client -connect site:sslport That works great. When it connects, I can see the exchange and I am left with a blank STDIN. I type <ping> and receive a <pong> back. I have tried to reproduce this in perl and have been unable to do so. I faced this issue before and used IO::S::SSL to get me by. However, I'd really like to watch each part manually and interact with it live. In perl, I am able to use something like:

#!/usr/bin/perl $r = exec("openssl s_client -connect site:sslport"); print $r;
or
#!/usr/bin/perl open(FH,"-|","openssl s_client -connect site:sslport"); while(<FH>){ print $_; } close(FH);
However, whenever I try to add
print FH "<ping>";
or
print(FH, "<ping>");
Nothing happens. It stays at the regular STDIN as if I executed it on terminal and accepts ping the same way. I would love some help to achieve sending the ping programmatically while openssl is open and staying open. As I would like to then capture the PONG and do other interactive send and captures. Someone, please guide me. Thank you. PS: I am using perl5 and I'm able to install any module. Sorry for any typing mistakes, my phone works as good as my perl. Thanks again, Gunther

In reply to Interactive openssl raw by Guntherssl

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.