Subject: | SSL_start not working |
Date: | Sat, 18 Jul 2015 21:49:53 +0200 |
To: | bug-IO-Socket-SSL [...] rt.cpan.org <bug-IO-Socket-SSL [...] rt.cpan.org> |
From: | Natxo Asenjo <natxo [...] asenjo.nl> |
hi,
IO::Socket::SSL version: 2.016.
Using a similar snippet as in http://search.cpan.org/~sullr/IO-Socket-SSL-2.016/lib/IO/Socket/SSL.pod#Basic_SSL_Client I get this error:
DEBUG: .../IO/Socket/SSL.pm:2649: new ctx 33030096
DEBUG: .../IO/Socket/SSL.pm:1389: start handshake
DEBUG: .../IO/Socket/SSL.pm:586: ssl handshake not started
DEBUG: .../IO/Socket/SSL.pm:619: using SNI with hostname alt1.gmail-smtp-in.l.google.com
DEBUG: .../IO/Socket/SSL.pm:654: request OCSP stapling
DEBUG: .../IO/Socket/SSL.pm:686: call Net::SSLeay::connect
DEBUG: .../IO/Socket/SSL.pm:689: done Net::SSLeay::connect -> -1
DEBUG: .../IO/Socket/SSL.pm:692: SSL connect attempt failed
DEBUG: .../IO/Socket/SSL.pm:692: local error: SSL connect attempt failed error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol
DEBUG: .../IO/Socket/SSL.pm:695: fatal SSL error: SSL connect attempt failed error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol
DEBUG: .../IO/Socket/SSL.pm:2682: free ctx 33030096 open=33030096
DEBUG: .../IO/Socket/SSL.pm:2687: free ctx 33030096 callback
DEBUG: .../IO/Socket/SSL.pm:2694: OK free ctx 33030096
SSL connect attempt failed error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol at /tmp/starttls.pl line 34.
use strict;
use warnings;
use autodie;
use IO::Socket::SSL;
$IO::Socket::SSL::DEBUG = 4;
my $smtp = IO::Socket::INET->new(
Proto => "tcp",
PeerAddr => "alt1.gmail-smtp-in.l.google.com",
PeerPort => 25,
);
IO::Socket::SSL->start_SSL(
$smtp,
SSL_hostname => "alt1.gmail-smtp-in.l.google.com" ,
) or die $SSL_ERROR;
using openssl works fine:
$ openssl s_client -starttls smtp -connect gmail-smtp-in.l.google.com:25
....
Timeout : 300 (sec)
Verify return code: 0 (ok)
---
250 SMTPUTF8
^C
I must be doing something wrong but I cannot see what exactly.
Any help greatly appreciated.
Regards,
Natxo Asenjo