1

The Lacewing library is supposed to support hosting a secure server.

It says if the certificate loads correctly, it should be secure. However, I'm hosting it and it says the certificate successfully loaded but when I send a message from client to server, I dont receive it. If a certificate is not loaded, I do.

#include <string>
#include <iostream>  
#define  LacewingFunction
#include "Lacewing.h"

void onReceive (Lacewing::Server &Server, Lacewing::Server::Client &Client,
                char * Data, int Size) {
                    /* callback body */
                    std::cout << Data << "\n";
}

void onConnect (Lacewing::Server &Server, Lacewing::Server::Client &Client)
{
    std::cout << "Connected!" << "\n";
    Client.Send("TestingS");
}



void onReceiveC (Lacewing::Client &Client, char * Data, int Size)
{
    std::cout << Data << "\n";
    Client.Send("TesingC");
}


int main(int argc, char* argv[])  
{  
    std::string s;
    std::cin >> s;
    if(s == "server")
    {
        Lacewing::EventPump pump;
        Lacewing::Server* server = new Lacewing::Server(pump);
        server->LoadSystemCertificate("MY","localhost");
        std::cout << server->CertificateLoaded();
        server->onReceive(onReceive);
        server->onConnect(onConnect);
        server->Host(1234);
        std::cout << server->CertificateLoaded();
        pump.StartEventLoop();
    }
    else
    {
        Lacewing::EventPump pump;
        Lacewing::Client* server = new Lacewing::Client(pump);
        server->onReceive(onReceiveC);
        server->Connect("192.168.2.12",1234);
        pump.StartEventLoop();
    }

    return 0;  
}  

Both times the certificate says it is loaded.

Here is the api docs. http://lacewing-project.org/docs/server/LoadSystemCertificate.html

Thanks

Maybe the certificate generated by makecert doesnt work? does anyone have a certificate I could try?

James M
  • 18,506
  • 3
  • 48
  • 56
jmasterx
  • 52,639
  • 96
  • 311
  • 557
  • possible duplicate of [Secure Handshake failing (SSL)](http://stackoverflow.com/questions/10589626/secure-handshake-failing-ssl) – user207421 May 14 '12 at 22:43

1 Answers1

1

I'm trying the same thing.

bSecure = WebServer.LoadSystemCertificate("My", "localhost","localmachine");
bSecure = WebServer.CertificateLoaded();

Both are true, so the certificate should be loaded.

Look here: how to make a certificate

This works fine in IE9, port set to 5040. https://localhost:5040/ It doesn't work in Firefox or Chrome, but this has something to do with loading the "Certification Authority" certificate.

eFMer
  • 26
  • 2
  • Could it be happening to me due to a port problem? The host and client are both local 127.0.0.1 .. I don't know much about certificates. – jmasterx May 14 '12 at 13:08
  • Why is it that the Client class has no notion of security? Is that normal? – jmasterx May 14 '12 at 13:13