AnyEvent::TLS and client certs

Mike Schilli anyevent at perlmeister.com
Wed Feb 29 00:18:10 CET 2012


I've got a client/server pair using both server and client SSL certs
with AnyEvent. While the server hands out its cert and the client runs
it against its ca file flawlessly, something's wrong with the client
cert setup.

In the server, I use

         tls      => "accept",
         tls_ctx  => {
               # server

               # server provides server cert for the client
             cert_file => "server.crt",
             key_file  => "server.key",

               # server requests/verifies client cert
            verify                     => 1,
            verify_require_client_cert => 1,
            ca_file                    => "server.crt",
            ca_path                    => ".",
        },

and on the client,

        tls => "connect",
        tls_ctx => {
              # client

              # client validates server's cert
            verify  => 1,
            ca_file => "server.crt",
            ca_path => ".",

              # client provides client cert to server
            cert_file => "worker.crt",
            key_file  => "worker.key",
        },
     );

respectively.

However, I get

     Protocol error
     ssl3_get_client_certificate: peer did not return a certificate

on the server and

     Error on connection to 127.0.0.1:8888: Broken pipe (Broken pipe)

on the client.

So this has to do with the client cert verification by the server, for some 
reason the client doesn't seem to send it (just to verify, if you disable
'verify_require_client_cert' on the server then they talk to each other
without problems).

Anything I'm missing in the setup above?

Thanks for any help.

-- 
-- Mike

anyevent at perlmeister.com



More information about the anyevent mailing list