tls_transport class
#include <nxtio/net.hpp>
Async TLS transport with the read/write shape used by HTTP helpers.
Constructors, destructors, conversion operators
-
tls_transport(std::
shared_ptr<coro::net::tls::context> ctx, coro::net::tls::client client) - Wrap an already-connected libcoro TLS client and context.
Public functions
-
auto read_some(std::
span<char> dst) → nxt:: task<std:: size_t> - Read decrypted bytes into
dst. -
auto read_some(std::
span<char> dst, std:: stop_token stop) → nxt:: task<std:: size_t> - Read decrypted bytes into
dst, checkingstopwhile waiting. -
auto shutdown(std::
chrono:: seconds timeout = std:: chrono:: seconds{5}) → nxt:: task - Attempt an orderly TLS shutdown.
-
auto write_all(std::
string_view bytes) → nxt:: task - Encrypt and write all bytes.