noxxi / p5-io-socket-ssl

IO::Socket::SSL Perl Module
36 stars 60 forks source link

start_SSL causes debug error "Undefined SSL object" #110

Closed thockar closed 3 years ago

thockar commented 3 years ago

every time a socket->start_SSL is called , the debug contains

.... SSL-DEBUG: .../IO/Socket/SSL.pm:1620: start handshake SSL-DEBUG: .../IO/Socket/SSL.pm:1177: global error: Undefined SSL object SSL-DEBUG: .../IO/Socket/SSL.pm:1061: starting sslifying ....

the "Undefined SSL object" error is caused in sub start_SSL line 1621 because $socket->blocking is called, without having a SSL_object for it --- related to $auto_retry/OpenSSL 1.1.1 and line 1174 if ($autoretry) { *blocking = sub { my $self = shift; { @ && $auto_retry->($self->_get_sslobject || last, @); } return $self->SUPER::blocking(@_); }; }

IMHO the line 1621 (getting the blocking state of the socket before the upgrade is done to restore it later) my $was_blocking = $socket->blocking(1); should be done before the socket is blessed to IO::Socket::SSL ($class) - e.g. in line 1609

this issue is'nt urgent, it has (IMHO) no functional impact

best regards

thockar

gilleslamiral commented 2 years ago

Thanks! It had no functional impact but it was bloody disturbing for users when another SSL error occurred later, they usually thought it was the problem, but it wasn't.