Guntherssl has asked for the wisdom of the Perl Monks concerning the following question:
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:
or#!/usr/bin/perl $r = exec("openssl s_client -connect site:sslport"); print $r;
However, whenever I try to add#!/usr/bin/perl open(FH,"-|","openssl s_client -connect site:sslport"); while(<FH>){ print $_; } close(FH);
orprint 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, Guntherprint(FH, "<ping>");
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Interactive openssl raw
by haukex (Archbishop) on Dec 06, 2016 at 11:59 UTC | |
by Guntherssl (Initiate) on Dec 06, 2016 at 12:10 UTC | |
by haukex (Archbishop) on Dec 06, 2016 at 13:14 UTC |