Can you tell me (or show code which is better) how to configure boost::asio::ssl::context to work properly with TLS? I use websocket-server (websocket++) which uses boost::asio to configure. What options should I set to make it works? I know that I should set
context_ptr ctx = websocketpp::lib::make_shared<boost::asio::ssl::context>(boost::asio::ssl::context::sslv23);
ctx->set_options(boost::asio::ssl::context::default_workarounds);
to work with sslv23 and higher (including my TLS). I want to set somehow to server my RSA key that I hold in memory. Websockets must also set up it somehow to pass this TLS auth. And how can I set this needed parameters in websockets?
ps: sorry for dummy questions
WebSocket++ uses a policy-based approach to enable TLS support on an endpoint. The configuration policy for Boost.Asio TLS support is in the
websocketpp/config/asio.hpp
header file. Upon including it, instantiating a server with thewebsocketpp::config::asio_tls
policy will allow one to provideboost::asio::ssl::context
through a callback provided toset_tls_init_handler()
:See the official echo_server_tls example for a complete example on WebSocket++ TLS support.