akay has asked for the wisdom of the Perl Monks concerning the following question:
I've got a problem when using IO::Socket::SSL.
Everything works fine under normal operation but I had an issue where the web server (IIS) locked up and Perl got stuck, even after the web server became active again.
I'm running the Perl script as an exe under Windows and I can't actually see the program running as it is hidden - here is the code:
sub api_action { $api_action = $_[0]; use IO::Socket::SSL; $EOL = "\015\012"; $BLANK = $EOL x 2; $remote = IO::Socket::SSL->new( Proto => "tcp", PeerAddr => "api.xxxxx", PeerPort => "443", SSL_verify_mode => SSL_VERIFY_NONE, verify_hostname => 0, Timeout => 120, ); unless ($remote) { print "cannot connect to API\n"; return "ERROR" +; } $remote->autoflush(1); print $remote "GET /API/?action=$api_action" . $BLANK; return <$remote>; close $remote; }
My thought is that it has made the initial connection, but is still waiting for a return from the GET command. I would have thought setting the Timeout would just cause it to return the error but it doesn't look like it works.
Any ideas on where I'm going wrong or what I've missed?
Thanks
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: IO::Socket::SSL problem with web server hang
by zentara (Cardinal) on May 02, 2017 at 12:24 UTC | |
|
Re: IO::Socket::SSL problem with web server hang
by noxxi (Pilgrim) on May 02, 2017 at 19:26 UTC |