安全握手失败(SSL)

时间:2012-05-14 19:56:07

标签: c++ networking ssl liblacewing

我正在使用一个名为Lacewing的图书馆。 http://lacewing-project.org/

它使用windows crypt api创建一个安全的服务器。

我已经为我的PC(Josh-Laptop)创建了一个证书,我使用netsh将它绑定到端口8012.Lacewing说证书已成功加载。

然后来问题。我正在尝试将来自我家(主机)的1台电脑发送给另一台(客户端)。

如果我没有加载证书并在不安全模式下使用它,则会发送和接收所有消息。

    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;
    }

在客户端,我收到'test'。在服务器端,库发出错误,说“握手失败”,“重叠io操作正在进行中”

这是我加载证书的方式:

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

为什么握手会失败?有什么我不明白的吗? 感谢

0 个答案:

没有答案