Hi Monks!
Is there a way to pass a new SSH server host keys since it was changed in the host server or to update this key from a Perl scrip using Net::FTPSSL.
When my Perl script runs it gives this error message:
"Can't open xxx.xxx.xxx.xxx: SSL connect attempt failed"
Posting a test code here which gives the same error. If I use Filezilla, it detects that the server key was changed, asks to accept the new key and connects, but from the Perl script, it doesn't, I guess I have to send a flag or the key it sefl in the code, thats where my problem is, any suggestions?
Test Code:
#!/usr/bin/perl
use strict;
use warnings;
use Net::FTPSSL;
open (STDERR, "> logfile.txt"); # Redirects STDERR to this file.
my %connectionHash = (
Port => 21,
Encryption => 'E',
Debug => 1,
OverridePASV => 'xxx.xxx.xxx.xxx',
Croak => 0,
PreserveTimestamp => 0,
);
my %sslHash = (
#SSL_cert_file => '',
#SSL_reuse_ctx => '',
SSL_key_file => 'MD5:9f:...f9',
#SSL_ca_file => '',
#SSL_use_cert => 1,
);
$connectionHash{SSL_Client_Certificate} = \%sslHash;
my $ftps = Net::FTPSSL->new(
'xxx.xxx.xxx.xxx:',
%connectionHash,
);
$ftps->login ('user', 'pass') or warn "Could not login to xxx.xxx.xxx
+.xxx: ", $ftps->message;
$ftps->nlst();
$ftps->quit();
Thanks for looking!
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.