0

I'm usng a library called Lacewing. http://lacewing-project.org/

It uses windows crypt api to make a secure server.

I have created a certificate for my PC (Josh-Laptop), and I used netsh to bind it to port 8012. Lacewing says the certificate is successfully loaded.

Then come the problems. I'm trying to send messages from 1 pc in my house (the host) to another (the client).

When I do not load a certificate and use it in unsafe mode, all messages are sent and received.

    void ServerCore::onConnect( Lacewing::Server::Client &client )
    {
        client.SendWritable("test");
    }

...

    void ServerCore::onReceive( 
        Lacewing::Server::Client &client, char * data, int size )
    {
        getServer().FirstClient()->SendWritable("test");
        client.SendWritable("test");
        std::cout << data << " was received from " << client.GetAddress().ToString() << std::endl;
    }

    void ClientCore::onConnect()
    {
        getClient().Send("test");
    }


    void ClientCore::onReceive( char * data, int size )
    {
        getClient().Send("Okay then...");
        std::cout << data << std::endl;
    }

On the client side, I receive 'test'. On the server side, the library spits out an error saying "hand shake failed", "overlapped io operation is in progress"

This is how I load the certificate:

getServer().LoadSystemCertificate("MY","JOSH-LAPTOP","localmachine");

Why would the handshake fail? Is there something I do not understand? Thanks

James M
  • 18,506
  • 3
  • 48
  • 56
jmasterx
  • 52,639
  • 96
  • 311
  • 557
  • I don't think that error message is correct. Could there be something wrong with the certificate you're using? – James M May 26 '12 at 20:14
  • @James McLaughlin I have tried all kinds of self signed certs. None of them worked. Probably my fault though. Do you know of a tutorial I can follow to make one that you know works with Lacewing? Thanks! – jmasterx May 29 '12 at 19:29

0 Answers0