specialunderwear/websocketpp — comment on commit 77a2208501cb88957d9fa4483d33c00b0435cd7a
File:  line 0
By megabyte1024:

Hm.. Here is my real working code of both client and server handlers and it does not use the io_service

boost::shared_ptr CWebSocketServerHandler::on_tls_init(void) {
// create a tls context, init, and return.
boost::shared_ptr context(new boost::asio::ssl::context(boost::asio::ssl::context::tlsv1));
try {
context->set_options(boost::asio::ssl::context::default_workarounds |
boost::asio::ssl::context::no_sslv2 |
boost::asio::ssl::context::single_dh_use);
context->set_password_callback(boost::bind(&type::get_password, this));
context->use_certificate_chain_file(m_strCAFilePath);
context->use_private_key_file(m_strKeyFilePath, boost::asio::ssl::context::pem);
} catch (std::exception& e) {
std::cout << e.what() << std::endl;
}
return context;
}

boost::shared_ptr CWebSocketClientHandler::on_tls_init(void) {
// create a tls context, init, and return.
boost::shared_ptr context(new boost::asio::ssl::context(boost::asio::ssl::context::tlsv1));
try {
context->set_verify_mode(boost::asio::ssl::context::verify_peer);
context->load_verify_file(m_strCAFilePath);
} catch (std::exception& e) {
std::cout << e.what() << std::endl;
}
return context;
}