Hi,

I'm writing a test-case for the Perl bindings that basically is just  
server from SSLsample. However when I try to connect to it I get an  
assertation failure: PR_Assert (s=0x86d2c "numPresent > 0 ||  
numEnabled == 0", file=0x86ced "ssl3con.c", ln=670). My NSS is 3.12

The code below shows what I'm doing

<snip>

   use Crypt::NSS config_dir => "db", cipher_suite => "US";

   my $sock = Net::NSS::SSL->create_socket("tcp");
   $sock->set_option(Blocking => 1);

   $sock->bind("127.0.0.1", $port);
   $sock->listen();
   $sock->import_into_ssl_layer();
   $sock->configure_as_server($private_cert, $private_key);

   my $client = $sock->accept(); # <- does an automatic SSL_ImportFD  
on the new fd
   $client->set_option(Blocking => 1);
   $client->set_option(SSL_SECURITY, SSL_OPTION_ENABLE);
   $client->set_option(SSL_HANDSHAKE_AS_SERVER, SSL_OPTION_ENABLE);
   $client->set_option(SSL_REQUEST_CERTIFICATE, SSL_OPTION_DISABLE);
   $client->set_option(SSL_REQUIRE_CERTIFICATE, SSL_OPTION_DISABLE);
   $client->set_pkcs11_pin_arg(DB_PASSWORD);

   $client->reset_handshake(1);

   my $buff;
   while($client->read($buff) > 0) {
       if ($buff eq "quit") {
           $client->close();
       }
           $client->write(reverse $buff);
       }
   }

   $sock->close();

</snip>

The DB I'm using is created using the instructions on 
http://www.mozilla.org/projects/security/pki/nss/ref/ssl/gtstd.html#1012351 
  and works with the server app in SSLsample.

Any obvious things I'm doing wrong or missing?

oh, and sorry for the quite ugly API right now.. the "new" constructor  
will hide the bind/listen stuff and accept take options to hide the  
set_option etc calls for you.

Cheers,
Claes

_______________________________________________
dev-tech-crypto mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-crypto

Reply via email to