...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
Detect a TLS client handshake on a stream.
Defined in header <boost/beast/core/detect_ssl.hpp>
template< class SyncReadStream, class DynamicBuffer> bool detect_ssl( SyncReadStream& stream, DynamicBuffer& buffer, error_code& ec);
This function reads from a stream to determine if a client handshake message is being received.
The call blocks until one of the following is true:
The algorithm, known as a composed operation, is implemented
in terms of calls to the next layer's read_some
function.
Bytes read from the stream will be stored in the passed dynamic buffer, which may be used to perform the TLS handshake if the detector returns true, or be otherwise consumed by the caller based on the expected protocol.
Name |
Description |
---|---|
|
The stream to read from. This type must meet the requirements of SyncReadStream. |
|
The dynamic buffer to use. This type must meet the requirements of DynamicBuffer. |
|
Set to the error if any occurred. |
true
if the buffer contains
a TLS client handshake and no error occurred, otherwise false
.