Skip Menu |

This queue is for tickets about the POE-Component-Jabber CPAN distribution.

Report information
The Basics
Id: 16208
Status: resolved
Priority: 0/
Queue: POE-Component-Jabber

People
Owner: Nobody in particular
Requestors: picz [...] sifira.dk
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.1
Fixed in: (no value)



Subject: Handshake errors while connecting to Google Talk with XMPP over TLS
I use POE::Component::Jabber::Client::XMPP to connect to Google's servers. In about one out of three attempts to connect, I get a 'handshake error' from the POE::Component::Jabber::Client::XMPP::TLS. It could be my network configuration. It could also be a bug in openSSL. I have included a small sample app, which demonstrates the problem. It will write "handshake error" to STDERR if the TLS socket connection fails.
#!/app/im/bin/perl -w use strict; use POE; use POE::Component::Jabber::Client::XMPP qw(); POE::Session->create ( inline_states => { _start => \&handler_start, _stop => \&handler_stop, jam_init_finished => \&jam_init_finished, jam_input_event => \&jam_input_event, jam_error_event => \&jam_error_event, } ); POE::Kernel->run(); exit; sub handler_start { my ($kernel, $session) = @_[ KERNEL, SESSION ]; print "Handler start\n"; $kernel->alias_set( 'mainS' ); POE::Component::Jabber::Client::XMPP->new (IP => 'talk.google.com', PORT => '5222', HOSTNAME => 'gmail.com', USERNAME => 'gtalkie', PASSWORD => 'xxxxxxx', RESOURCE => 'handshake_tester', ALIAS => 'xmppS', DEBUG => 0, STATE_PARENT => 'mainS', STATES => { InitFinish => 'jam_init_finished', InputEvent => 'jam_input_event', ErrorEvent => 'jam_error_event', } ); } sub handler_stop { print "Handler stop\n"; } sub jam_init_finished { my $kernel = $_[KERNEL]; print "jam_init_finished\n"; $kernel->post('xmppS', shutdown_socket => 0); } sub jam_input_event { } sub jam_error_event { print "jam_error_event\n"; }
This is a problem I found regarding the hacked together non-blocking TLS implementation I pulled from rocco's HTTP code, but only under extreme load. For whatever reason, I believe it to be a bug in Net::SSLeay which inturn could be a bug in openssl. I had not had the time to track it down properly and get a clean connect under 99% of circumstances when it comes to SSL negotiations under load. And your sample program is just a barebones connection. What would be more helpful would be a dumped TCP stream showing the exchanges and what possibly could be failing. If I have time this weekend, I will take a closer look. And as always, patches are very welomed. PS. I have considered using the PoCo::SSLify since it is actively maintained by someone else, but I have not had the time to consider it fully. An entire session overhead just for managing the SSL socket seems overboard when the current tied IO::Handle seems much more simple, even if ugly. [PICZ - Wed Nov 30 09:43:08 2005]: Show quoted text
> I use POE::Component::Jabber::Client::XMPP to connect to Google's > servers. In about one out of three attempts to connect, I get a > 'handshake error' from the > POE::Component::Jabber::Client::XMPP::TLS. > > It could be my network configuration. It could also be a bug in > openSSL. > > I have included a small sample app, which demonstrates the problem. It > will write "handshake error" to STDERR if the TLS socket connection > fails.
PoCo::SSLify is now used. New release out on CPAN. On Wed Nov 30 10:41:53 2005, NPEREZ wrote: Show quoted text
> This is a problem I found regarding the hacked together non-blocking > TLS implementation I pulled from rocco's HTTP code, but only under > extreme load. For whatever reason, I believe it to be a bug in > Net::SSLeay which inturn could be a bug in openssl. I had not had the > time to track it down properly and get a clean connect under 99% of > circumstances when it comes to SSL negotiations under load. And your > sample program is just a barebones connection. What would be more > helpful would be a dumped TCP stream showing the exchanges and what > possibly could be failing. If I have time this weekend, I will take a > closer look. > > And as always, patches are very welomed. > > PS. I have considered using the PoCo::SSLify since it is actively > maintained by someone else, but I have not had the time to consider it > fully. An entire session overhead just for managing the SSL socket > seems overboard when the current tied IO::Handle seems much more > simple, even if ugly. > > [PICZ - Wed Nov 30 09:43:08 2005]: >
> > I use POE::Component::Jabber::Client::XMPP to connect to Google's > > servers. In about one out of three attempts to connect, I get a > > 'handshake error' from the > > POE::Component::Jabber::Client::XMPP::TLS. > > > > It could be my network configuration. It could also be a bug in > > openSSL. > > > > I have included a small sample app, which demonstrates the problem. It > > will write "handshake error" to STDERR if the TLS socket connection > > fails.
> >