...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/experimental/core/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 type of the lowest layer. |
|
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 a reference to the lowest layer. |
|
Get the underlying implementation in the native type. |
|
Get a reference to the next layer. |
|
Move Assignment. |
|
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. Move Constructor. |
|
Write some data to the stream. |
The stream class template provides asynchronous and blocking stream-oriented functionality using SSL.
Distinct objects: Safe.
Shared objects: 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 boost::asio::ip::tcp::socket
,
you would write:
boost::asio::io_context ioc; boost::asio::ssl::context ctx{boost::asio::ssl::context::sslv23}; boost::beast::ssl_stream<boost::asio:ip::tcp::socket> sock{ioc, ctx};
In addition to providing an interface identical to boost::asio::ssl::stream
, the wrapper has the following additional
properties:
flat_stream
internally, as a
performance work-around for a limitation of boost::asio::ssl::stream
when writing buffer sequences having length greater than one.