Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^5: instantiating an SFTP object

by zentara (Archbishop)
on Jun 13, 2017 at 19:29 UTC ( [id://1192728]=note: print w/replies, xml ) Need Help??


in reply to Re^4: instantiating an SFTP object
in thread instantiating an SFTP object

Hi, I don't want to feel like a dufus, but I tried
my $return = $ssh2->check_hostkey(LIBSSH2_HOSTKEY_POLICY_ASK); print "Return: $return\n\n\n\n";
and all I get is Return 00 and the normal filehandle printout. How exactly do I efficiently print out the returns from the check_hostkey command.? I'm cultivating laziness. :-)

I'm not really a human, but I play one on earth. ..... an animated JAPH

Replies are listed 'Best First'.
Re^6: instantiating an SFTP object
by salva (Canon) on Jun 13, 2017 at 21:35 UTC
    If the remote host key is good enough for the given policy, the method returns a true value. Otherwise it returns undef and the error (or die_with_error) method can be used to find out the failure cause.
    $ssh2->check_hostkey(LIBSSH2_HOSTKEY_POLICY_ASK) or $ssh2->die_with_error;
    The 0-but-true value 00 is equal to LIBSSH2_KNOWNHOST_CHECK_MATCH.
      The 0-but-true value 00 is equal to LIBSSH2_KNOWNHOST_CHECK_MATCH.

      That's good isn't it? :-)


      I'm not really a human, but I play one on earth. ..... an animated JAPH

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1192728]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2024-04-25 15:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found