boost::corosio::openssl_stream
A TLS stream using OpenSSL.
Synopsis
class openssl_stream
: public tls_stream
Description
This class wraps an underlying stream derived from io_stream and provides TLS encryption using the OpenSSL library.
Inherits handshake(), shutdown(), read_some(), and write_some() from tls_stream.
Example
tls::context ctx;
ctx.set_hostname( "example.com" );
ctx.set_verify_mode( tls::verify_mode::peer );
corosio::socket raw_socket( ioc );
raw_socket.open();
co_await raw_socket.connect( endpoint );
corosio::openssl_stream secure( raw_socket, ctx );
co_await secure.handshake( openssl_stream::client );
// Use secure stream for TLS communication
Member Functions
Name |
Description |
|
Construct an OpenSSL stream. |
|
Destructor. |
Return the execution context. |
|
Returns the underlying implementation. |
|
Perform the TLS handshake asynchronously. |
|
|
|
Initiate an asynchronous read operation. |
|
Perform a graceful TLS shutdown asynchronously. |
|
Initiate an asynchronous write operation. |