eidheim / Simple-WebSocket-Server

A very simple, fast, multithreaded, platform independent WebSocket (WS) and WebSocket Secure (WSS) server and client library implemented using C++11, Boost.Asio and OpenSSL. Created to be an easy way to make WebSocket endpoints in C++.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Use the wss protocol what the cipher suite in this program

Wangweilai1 opened this issue · comments

As the title to say, Use the wss protocol what the cipher suite in this program, I can't find the cipher suite list in this program, I use a certificate is AES128-GCM-SHA256 arithmetic, But it doesn't work, Can you tell me where the cipher suite list in this program, so that i can create a suit certificate.
Thanks for you help.

I am pretty sure the cipher suite list is dependent on your OpenSSL installation. On a Unix-like system I would simply write: openssl ciphers in a shell.

My OS is Windows, and I want use this program as an Windows Service and client is browser, that is to say ,windows service and browser in one same computer, so I must use self signed certificate, but I self create a certificate use AES128-GCM-SHA256 arithmetic, and i found it doesn't work in this program, so it throw myself for a loss, WSS protocol :
`acceptor->async_accept(connection->socket->lowest_layer(), [this, connection](const error_code &ec) {
//Immediately start accepting a new connection (if io_service hasn't been stopped)
if(ec != asio::error::operation_aborted)
accept();

    if(!ec) {
      asio::ip::tcp::no_delay option(true);
      connection->socket->lowest_layer().set_option(option);
      //Set timeout on the following asio::ssl::stream::async_handshake
      auto timer = get_timeout_timer(connection, config.timeout_request);
      connection->socket->async_handshake(asio::ssl::stream_base::server, [this, connection, timer](const error_code &ec) {
        if(timer)
          timer->cancel();
		if (ec)
		{
			using namespace std;
			std::cout << "Error Code: " << ec.value() << std::endl;
			std::cout << "Error Message: "<< ec.message() << std::endl;
			std::cout << "Error Category Name: " << ec.category().name() << std::endl;
		}
        if(!ec)
          read_handshake(connection);
      });`

in async_handshake function the ec always have a error code as follow
Error Code: 335544539
Error Message: short read
Error Category Name: asio.ssl
I don't know whether IE11 browser prevent connect with this windows server or not, but I already manually added CA certificate into IE11. but it also doesn't work, so can you help me to solve this problem?
My environment:
OS: windows10, IDE:VS2015, Boost: boost_1_64_0, openssl: 1.0.2,

I was sincerely thanks for you help, and looking forward to your reply.

Thank for you help, I already solve this problem, The error is that in the wss_examples.cpp
WssServer server("server.crt", "server.key"); I changed into WssServer server("server.crt", "server.key", "ca.crt"); so that create this problem, when i delete the "ca.crt", it can connect with browser, I don't know why not add "ca.crt"?, in my opinion it should add ca.crt ,but it's error.
in the end, Thank for you help.