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' ) {