boost::corosio::tls_stream::handshake

Asynchronously perform the TLS handshake.

Synopsis

[[nodiscard]]
virtual
capy::task<capy::results<>>
handshake(tls_role role) = 0;

Description

Initiates the TLS handshake process. For client connections, this sends the ClientHello and processes the server's response. For server connections, this waits for the ClientHello and sends the server's response.

A handshake attempt consumes the stream state, whether it succeeds or not. A subsequent call behaves as if reset() ran first, and performs a fresh handshake using the current configuration.

Return Value

An awaitable yielding (error_code).

The return value should not be discarded.

Parameters

Name

Description

role

The handshake role, client or server.

Preconditions

  • The underlying stream must be connected. No other TLS operation may be in progress on this stream.

Created with MrDocs