Skip Menu |

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

Report information
The Basics
Id: 34442
Status: resolved
Priority: 0/
Queue: POE-Component-SSLify

People
Owner: Nobody in particular
Requestors: ASCENT [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: (no value)



Subject: SSLify doesn't support key/cert as client
Hello, I tried to use POE::Component::SSLify on client connection to server which verify peer by certificate. As far as I see, it's not supported by this module. I have attached small patch which will make it possible (and works fine).
Subject: client_certificate.patch
--- SSLify.pm.orig 2007-12-13 19:33:51.000000000 +0100 +++ SSLify.pm 2008-03-10 23:19:00.000000000 +0100 @@ -110,7 +110,7 @@ # Now, we create the new socket and bind it to our subclass of Net::SSLeay::Handle my $newsock = gensym(); - tie( *$newsock, 'POE::Component::SSLify::ClientHandle', $socket, $version, $options ) or die "Unable to tie to our subclass: $!"; + tie( *$newsock, 'POE::Component::SSLify::ClientHandle', $socket, $ctx, $version, $options ) or die "Unable to tie to our subclass: $!"; # All done! return $newsock; --- SSLify/ClientHandle.pm.orig 2007-12-13 18:28:06.000000000 +0100 +++ SSLify/ClientHandle.pm 2008-03-10 23:20:13.000000000 +0100 @@ -19,10 +19,12 @@ # Override TIEHANDLE because we create a CTX sub TIEHANDLE { - my ( $class, $socket, $version, $options ) = @_; + my ( $class, $socket, $ctx, $version, $options ) = @_; - my $ctx; - if ( defined $version and ! ref $version ) { + if ( defined $ctx ) { + # Context already created. + } + elsif ( defined $version and ! ref $version ) { if ( $version eq 'sslv2' ) { $ctx = Net::SSLeay::CTX_v2_new(); } elsif ( $version eq 'sslv3' ) {
Added in SSLify v0.11, thanks! I wasn't sure of the exact usage case you had in mind, so please read the Client_SSLify section in the POD to see if it makes sense or not. Please feel free to give me feedback :) -- ~Apocalypse
From: ASCENT [...] cpan.org
On Pon. 09 Cze. 2008, 21:04:53, APOCAL wrote: Show quoted text
> Added in SSLify v0.11, thanks! I wasn't sure of the exact usage case you > had in mind, so please read the Client_SSLify section in the POD to see > if it makes sense or not.
Great :) Client_SSLify with key and cert works fine in v0.11. There is small inaccuracy in documentation at Client_SSLify function: my $ctx = SSLify_ContextCreate( undef, undef, 'server.key', 'server.crt' ); Should be: my $ctx = SSLify_ContextCreate('server.key', 'server.crt'); If this is not documentation error, but code error and you will change it to documentation way of usage - please let me know. I have SSL patch for POE::Component::Client::TCP, but I wait for stable way to pass key/cert.
Subject: Re: [rt.cpan.org #34442] SSLify doesn't support key/cert as client
Date: Tue, 10 Jun 2008 14:16:18 -0400
To: bug-POE-Component-SSLify [...] rt.cpan.org
From: Apocalypse <perl [...] 0ne.us>
Whoa, thanks for catching this! v0.13 is up on CPAN correcting this error in the POD. Looking forward to a stable SSLify for you to build on :) ~Apocalypse http://search.cpan.org/~APOCAL/ Dariusz Jackowski via RT wrote: Show quoted text
> Queue: POE-Component-SSLify > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=34442 > > > On Pon. 09 Cze. 2008, 21:04:53, APOCAL wrote:
>> Added in SSLify v0.11, thanks! I wasn't sure of the exact usage case you >> had in mind, so please read the Client_SSLify section in the POD to see >> if it makes sense or not.
> > Great :) Client_SSLify with key and cert works fine in v0.11. There is > small inaccuracy in documentation at Client_SSLify function: > > my $ctx = SSLify_ContextCreate( undef, undef, 'server.key', 'server.crt' ); > > Should be: > my $ctx = SSLify_ContextCreate('server.key', 'server.crt'); > > If this is not documentation error, but code error and you will change > it to documentation way of usage - please let me know. I have SSL patch > for POE::Component::Client::TCP, but I wait for stable way to pass key/cert. >
Ok, I sent example patch to POE RT: http://rt.cpan.org/Ticket/Display.html?id=36648 -- ASCENT