...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
Provides stream-oriented functionality using OpenSSL.
Defined in header <boost/beast/ssl/ssl_stream.hpp>
template< class NextLayer> class ssl_stream : public stream_base
Name |
Description |
---|---|
The type of the executor associated with the object. |
|
Structure for use with deprecated impl_type. |
|
The native handle type of the SSL stream. |
|
The type of the next layer. |
Name |
Description |
---|---|
Start an asynchronous SSL handshake. |
|
Start an asynchronous read. |
|
Asynchronously shut down SSL on the stream. |
|
Start an asynchronous write. |
|
Get the executor associated with the object. |
|
Perform SSL handshaking. |
|
Get the underlying implementation in the native type. |
|
Get a reference to the next layer. |
|
Read some data from the stream. |
|
Set the callback used to verify peer certificates. |
|
Set the peer verification depth. |
|
Set the peer verification mode. |
|
Shut down SSL on the stream. |
|
Construct a stream. |
|
Write some data to the stream. |
The stream class template provides asynchronous and blocking stream-oriented functionality using SSL.
Distinctobjects:Safe.
Sharedobjects:Unsafe. The application must also ensure that all asynchronous operations are performed within the same implicit or explicit strand.
To use this template with a tcp_stream
, you would write:
net::io_context ioc; net::ssl::context ctx{net::ssl::context::tlsv12}; beast::ssl_stream<beast::tcp_stream> sock{ioc, ctx};
In addition to providing an interface identical to net::ssl::stream
, the wrapper has the following additional
properties:
flat_stream
internally, as a
performance work-around for a limitation of net::ssl::stream
when writing buffer sequences having length greater than one.