Thread Net::FTP falsche Rückgabe bei ->starttls() (13 answers)
Opened by bianca at 2020-04-06 23:56

bianca
 2020-04-07 07:49
#191713 #191713
User since
2009-09-13
6977 Artikel
BenutzerIn

user image
Hier das Script:
Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/usr/bin/perl
use strict;
use warnings;

#perl test_ftp.pl

my $erg = losgehts();
print "Ergebnis: $erg\n";

sub losgehts {
    use Net::FTP;
    use IO::Socket::SSL qw(SSL_VERIFY_CLIENT_ONCE);
    my @hosts = (
        {
            url     => 'test .de',
            user    => 'abc',
            passw   => 'xyz',
        },
    );
    foreach my $ref (@hosts) {
        my $ftp = Net::FTP->new(
            $ref->{url},
            Debug               => 1,
            Passive             => 1,
            SSL_verify_mode     => SSL_VERIFY_CLIENT_ONCE,
            SSL_session_cache   => IO::Socket::SSL::Session_Cache->new(1),
        ) or return 'bei '.$ref->{url}.' ist Net::FTP->new() fehlgeschlagen';
        $ftp->starttls() or return 'bei '
            .$ref->{url}
            .' ist $ftp->starttls() fehlgeschlagen'
        ;
        print "Zeile ".__LINE__."\n";
        $ftp->login($ref->{user},$ref->{passw}) or return 'bei '
            .$ref->{url}
            .' ist $ftp->login($ref->{user},$ref->{passw}) fehlgeschlagen'
        ;
        print "Zeile ".__LINE__."\n";
        my $hash_ref = $ftp->dir() or return 'bei '
            .$ref->{url}.' ist $ftp->dir(\'/\') fehlgeschlagen'
        ;
        print "Zeile ".__LINE__."\n";
    }
    print "Zeile ".__LINE__."\n";
}

Und das Trace:
Quote
Net::FTP>>> Net::FTP(3.11)
Net::FTP>>> Exporter(5.70)
Net::FTP>>> Net::Cmd(3.11)
Net::FTP>>> IO::Socket::SSL(2.060)
Net::FTP>>> IO::Socket::IP(0.32)
Net::FTP>>> IO::Socket(1.36)
Net::FTP>>> IO::Handle(1.34)
Net::FTP=GLOB(0x3290ce8)<<< 220 FTP server
Net::FTP=GLOB(0x3290ce8)>>> AUTH TLS
Net::FTP=GLOB(0x3290ce8)<<< 234 AUTH TLS successful
Ergebnis: bei test .de ist $ftp->starttls() fehlgeschlagen

Last edited: 2020-04-07 07:52:22 +0200 (CEST)
10 print "Hallo"
20 goto 10

View full thread Net::FTP falsche Rückgabe bei ->starttls()