Hi All,
I'm writing TLS client/server and my server is continuously crashing in the
async_handshake function. I'm running out of ideas of what I'm doing wrong
or how to solve the issue. I'm using VS 2022 and the latest boost from
github. Tested with 1.78.0 as well. Using OpenSSL 3.0.1.
Code is compiled as x64, /std:c++20. Using a single thread.
Simplified function call:
on_accept:
auto server = boost::make_shared(std::move(socket),
m_ioc, m_ctx);
server->run();
run:
boost::asio::dispatch(m_ws.get_executor(),
boost::beast::bind_front_handler(&cserver_session_ws::on_run,
shared_from_this()));
on_run:
m_ws.next_layer().async_handshake(boost::asio::ssl::stream_base::server,
boost::beast::bind_front_handler(&cserver_session_ws::on_handshake,
shared_from_this()));
on_handshake function never gets called, due to the crash in
async_handshake function.
m_ws is defined as:
boost::beast::websocket::streamboost::beast::tcp_stream>
m_ws;
Exception call stack:
Unhandled exception thrown: read access violation.
**this** was 0x1.
boost::asio::detail::scheduler::post_immediate_completion(boost::asio::detail::scheduler_operation
...... Line 349
boost::asio::detail::select_reactor::schedule_timer