context_ptr tls_init_handler(websocketpp::connection_hdl) { context_ptr ctx = websocketpp::lib::make_shared<boost::asio::ssl::context>(boost::asio::ssl::context::sslv23); // use ssl23 and higher
try { ctx->set_options(boost::asio::ssl::context::default_workarounds |
boost::asio::ssl::context::no_sslv2 |
boost::asio::ssl::context::no_sslv3 |
boost::asio::ssl::context::single_dh_use);
ctx->set_verify_mode(boost::asio::ssl::verify_peer |
boost::asio::ssl::verify_fail_if_no_peer_cert);
ctx->load_verify_file("/home/liman_da/workspace/shield_ssl/ca.crt"); } catch (std::exception& e) { LOGE("tls_init_handler exception: " << e.what()); }
return ctx;
}