Show quoted text>
> fileno($socket) doesn't work after $socket->accept_SSL fails with an error (like a bad
> handshake).
> This in turn seems to break IO::Poll which only removes handles that return something else than
> undef on fileno($socket).
Please give an example program to reproduce the error, because in the
following test program I cannot reproduce the error, e.g. both sock->fileno
and fileno(sock) return the same valid value.
Please make sure that the example program is as small as possible so that I
can better verify that the problem is in IO::Socket::SSL and not some third
party library or bad usage etc.
-------
use strict;
use warnings;
use IO::Socket::SSL;
# create Server on random port
my $srv = IO::Socket::INET->new(
LocalAddr => '0.0.0.0',
Listen => 10
) or die $!;
my $saddr = $srv->sockhost.':'.$srv->sockport;
# fork client
defined(my $pid = fork()) or die $!;
exit(client()) if $pid == 0;
# wait for connect
my $cl = $srv->accept;
# try upgrade to SSL
IO::Socket::SSL->start_SSL($cl,
SSL_server => 1,
SSL_verify_mode => 0x00,
) or warn $SSL_ERROR;
warn 'fileno($cl)='.fileno($cl);
warn '$cl->fileno='.$cl->fileno;
# wait for client end
wait;
sub client {
close($srv);
# connect
my $cl = IO::Socket::INET->new($saddr) or die $!;
# just send stuff to let SSL handshake fail
syswrite($cl,'x' x 1000) or die $!;
# wait a bit before closing
sleep(5);
}