![]() |
boost::taar::server::tls — Coroutine that accepts TCP connections and runs a TLS handshake on each before handing the encrypted stream to session_handler.
// In header: <boost/taar/server/tls.hpp> template<typename SessionHandler> awaitable< void > tls(boost::asio::any_io_executor connection_executor, std::string bind_host, std::string bind_port, boost::asio::ssl::context & tls, SessionHandler && session_handler, cancellation_signals & signals, std::function< void(boost::asio::ip::tcp::endpoint const &)> local_endpoint_handler = nullptr, std::chrono::steady_clock::duration handshake_timeout = std::chrono::seconds {30});
Same binding and cancellation behaviour as tcp. A connection whose handshake fails or takes longer than handshake_timeout is dropped without involving the session. The session receives a boost::taar::session::tls_stream, so pair this acceptor with boost::taar::session::https (or basic_https<Context>).
Parameters: |
|
||||||||||||||||
Throws: |
boost::taar::exception carrying the system error code if name resolution, binding or listening fails. |