Subject: | client side verification |
Date: | Mon, 2 May 2011 20:10:26 +0200 |
To: | bug-poe-component-sslify [...] rt.cpan.org |
From: | Markus Lauer <ml [...] usermode.de> |
hi!
we talked on irc.
i try to access a ssl service which requires a special(?) kind of verification.
i think it's called "mutual certificate authentication".
when using openssl s_client i'll have to use -cert -key and -CAfile to get a
successful verified connection.
with IO::Socket::SSL use_cert, verfiy_mode are also (additionally) needed.
now to sslify:
inside PreConnect
my $ctx = SSLify_ContextCreate( $key, $cert );
# use_cert
my $res = Net::SSLeay::CTX_use_certificate_chain_file($ctx, $ca_cert);
DEBUG "Net::SSLeay::CTX_use_certificate_chain_file res: $res"; # -> 1
# verify_mode
eval { Net::SSLeay::CTX_set_verify($ctx, Net::SSLeay::VERIFY_PEER) };
die "Net::SSLeay::CTX_set_verify: $@" if $@;
my $socket = eval { Client_SSLify($_[ARG0],undef,undef,$ctx) };
all seems to be fine
i get a Connected event and then:
Client 1 got read error 0 (Normal disconnection)
out of nowhere
thanks,
markus
notice: i get a response from my service with Filter::SSL:
POE::Filter::SSL->new( client => 1, clientcert=>1, debug => 1, crt => $cert,
key => $key, cacrt => $ca_cert )
i can't use it however, because of other issues (buffering, initial ->put)