Thread [IO::Socket::SSL] Failed to use private key (21 answers)
Opened by bianca at 2015-10-14 19:11

bianca
 2015-10-15 11:35
#182616 #182616
User since
2009-09-13
6975 Artikel
BenutzerIn

user image
OK, ich war zu voreilig. Der Connect klappt jetzt aber ->starttls() leider nicht.
Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/perl
use strict;
use warnings;
use Net::FTP 3.07;
use Net::FTP::File 0.06;

# perl -MIO::Socket::SSL=debug4 test_ftp.pl

my $ftp = Net::FTP->new(
    'hosturl',
    Timeout         => 10,
    SSL_ca_file     => 'mozilla_cacert.pem',    # dies ist die Datei aus Mozilla::CA Version 20150826
    debug           => 1,
) or do { print "\$@ = '$@'"; exit(); };
$ftp->starttls() or print "mist";

Quote
DEBUG: .../IO/Socket/SSL.pm:2602: new ctx 38895600
DEBUG: .../IO/Socket/SSL.pm:542: socket not yet connected
DEBUG: .../IO/Socket/SSL.pm:544: socket connected
DEBUG: .../IO/Socket/SSL.pm:566: ssl handshake not started
DEBUG: .../IO/Socket/SSL.pm:599: using SNI with hostname hosturl
DEBUG: .../IO/Socket/SSL.pm:634: request OCSP stapling
DEBUG: .../IO/Socket/SSL.pm:653: set socket to non-blocking to enforce timeout=10
DEBUG: .../IO/Socket/SSL.pm:667: Net::SSLeay::connect -> -1
DEBUG: .../IO/Socket/SSL.pm:677: ssl handshake in progress
DEBUG: .../IO/Socket/SSL.pm:687: waiting for fd to become ready: SSL wants a read first
DEBUG: .../IO/Socket/SSL.pm:707: socket ready, retrying connect
DEBUG: .../IO/Socket/SSL.pm:2505: did not get stapled OCSP response
DEBUG: .../IO/Socket/SSL.pm:667: Net::SSLeay::connect -> -1
DEBUG: .../IO/Socket/SSL.pm:677: ssl handshake in progress
DEBUG: .../IO/Socket/SSL.pm:687: waiting for fd to become ready: SSL wants a read first
DEBUG: .../IO/Socket/SSL.pm:707: socket ready, retrying connect
DEBUG: .../IO/Socket/SSL.pm:2458: ok=1 cert=44777104
DEBUG: .../IO/Socket/SSL.pm:2458: ok=1 cert=45582208
DEBUG: .../IO/Socket/SSL.pm:2458: ok=1 cert=45581824
DEBUG: .../IO/Socket/SSL.pm:2458: ok=1 cert=45581632
DEBUG: .../IO/Socket/SSL.pm:1570: scheme=ftp cert=45581632
DEBUG: .../IO/Socket/SSL.pm:1580: identity=hosturl cn=*.xxxx .com alt=2 *.xxxx .com 2 xxxx .com
DEBUG: .../IO/Socket/SSL.pm:1780: hostname verification failed
DEBUG: .../IO/Socket/SSL.pm:667: Net::SSLeay::connect -> -1
DEBUG: .../IO/Socket/SSL.pm:1791: SSL connect attempt failed

DEBUG: .../IO/Socket/SSL.pm:1796: SSL connect attempt failed error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
DEBUG: .../IO/Socket/SSL.pm:673: fatal SSL error: SSL connect attempt failed error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
DEBUG: .../IO/Socket/SSL.pm:2635: free ctx 38895600 open=38895600
DEBUG: .../IO/Socket/SSL.pm:2640: free ctx 38895600 callback
DEBUG: .../IO/Socket/SSL.pm:2647: OK free ctx 38895600
mist

Was ist jetzt falsch?

Meine Vermutung ist, dass das Zertifikat nicht im Speicher ist. Stimmt das? Es handelt sich um das Wurzelzertifikat vom Comodo. Und wenn ich die Webseite des Ziels mit Chrome öffne und das Zertifikat als Base64 in eine .cer Datei exportiere und hier einbinde bleibt der Fehler genau so bestehen. Das ändert nichts.

Und wenn ich das Zertifikat als .p7b Datei mit allen Zertifikaten im Zertifizierungspfad exportiere bekomme ich nur ein
Quote
DEBUG: .../IO/Socket/SSL.pm:1796: Invalid certificate authority locations
$@ = ''

Was mache ich falsch?
10 print "Hallo"
20 goto 10

View full thread [IO::Socket::SSL] Failed to use private key