aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/tls/asio/asio_stream.h
diff options
context:
space:
mode:
authorRenĂ© Meusel <[email protected]>2019-02-20 12:23:52 +0100
committerHannes Rantzsch <[email protected]>2019-04-16 10:47:51 +0200
commite2ca52cb6789bb5b92d9c601fc71d837d27fcd15 (patch)
treeb6220f4c81b4c4106f0d0682b3998f205eede432 /src/lib/tls/asio/asio_stream.h
parent1735bd0941187a96ec5c5a797d2db624c259d69b (diff)
add documentation
Diffstat (limited to 'src/lib/tls/asio/asio_stream.h')
-rw-r--r--src/lib/tls/asio/asio_stream.h24
1 files changed, 15 insertions, 9 deletions
diff --git a/src/lib/tls/asio/asio_stream.h b/src/lib/tls/asio/asio_stream.h
index 1cd2af87b..34b9635a9 100644
--- a/src/lib/tls/asio/asio_stream.h
+++ b/src/lib/tls/asio/asio_stream.h
@@ -202,6 +202,12 @@ class Stream final : public StreamBase<Channel>
//
// -- -- asio::ssl::stream compatibility methods
//
+ // The OpenSSL-based stream contains an operation flag that tells
+ // the stream to either impersonate a TLS server or client. This
+ // implementation defines those modes at compile time (via template
+ // specialization of the StreamBase class) and merely checks the
+ // flag's consistency before performing the respective handshakes.
+ //
void handshake(handshake_type type)
{
@@ -217,6 +223,15 @@ class Stream final : public StreamBase<Channel>
}
}
+ template <typename HandshakeHandler>
+ BOOST_ASIO_INITFN_RESULT_TYPE(HandshakeHandler,
+ void(boost::system::error_code))
+ async_handshake(handshake_type type, HandshakeHandler&& handler)
+ {
+ validate_handshake_type(type);
+ return async_handshake(handler);
+ }
+
template<typename ConstBufferSequence>
void handshake(handshake_type type, const ConstBufferSequence& buffers)
{
@@ -237,15 +252,6 @@ class Stream final : public StreamBase<Channel>
}
}
- template <typename HandshakeHandler>
- BOOST_ASIO_INITFN_RESULT_TYPE(HandshakeHandler,
- void(boost::system::error_code))
- async_handshake(handshake_type type, HandshakeHandler&& handler)
- {
- validate_handshake_type(type);
- return async_handshake(handler);
- }
-
template <typename ConstBufferSequence, typename BufferedHandshakeHandler>
BOOST_ASIO_INITFN_RESULT_TYPE(BufferedHandshakeHandler,
void(boost::system::error_code, std::size_t))