Search code examples
perlperl-modulestrawberry-perl

Net::SSH2::Simple failed after update to Windows10


there

On Net::SSH2::Simple,
It has been no longer connected by ssh after update Windows7 to Windows10.
With following error.

Net::SSH2::net_ss_timeout: invalid object Net::SSH2::Simple=SCALAR(0x3f5c218) at C:/Strawberry/perl/vendor/lib/Net/SSH2.pm line 111.
 at C:/Strawberry/perl/vendor/lib/Net/SSH2.pm line 111.
    Net::SSH2::connect(Net::SSH2::Simple=SCALAR(0x3f5c218), "xxxx.com", 22) called at C:/tool/eclipse_classic/workspace/test/work14.pl line 98
    (in cleanup) Net::SSH2::net_ss_DESTROY: invalid object Net::SSH2::Simple=SCALAR(0x3f5c218) at C:/tool/eclipse_oxygen/eclipse/workspace/.metadata/.plugins/org.epic.debug/perl5db.pl line 4211.

My code are

use Net::SSH2::Simple;

    $ssh2 = Net::SSH2::Simple->new();
    $ssh2->connect( 'xxxx.com', 22 ) ;
    $ssh2->auth_password( 'username', 'passwd' );

Error comes up at "$ssh2->connect" line.

But
This code works fine by using Net::SSH2.
Only Net::SSH2::Simple doesn't work.

To xxxx.com connection is fine. and no username,password mistakes found.

How can I fix that.

Windows10 64bit
Strawberry Perl 5.30.1.1 (64bit)
Eclipse Oxygen
EPIC 0.77

Thanks


Solution

  • Net::SSH2::Simple 0.01 was released Dec 13 2009. At that time Net::SSH2 was at 0.28 (2009-10-24), it is now at 0.70 (2019-3-17).

    I got Net::SSH2::Simple to work on Windows10 64bit / Strawberry Perl 5.30.0.1 (64bit) by installing the earlier version 0.58 (2015-12-20) of Net::SSH2 using

    cpan install SALVA/Net-SSH2-0.58.tar.gz
    

    Version 0.59_20 (2016-05-11) gives the 'net_ss_timeout: invalid object' error . The change log for version 0.59_01 has this warning

          ** WARNING: this release includes lots of changes, some
          visible, most internal. Regressions are expected. Also,
          it introduces some minor backward incompatible changes -
          but in those cases, the old behavior was broken or insane
          anyway.