aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/tls/asio/asio_stream.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/tls/asio/asio_stream.h')
-rw-r--r--src/lib/tls/asio/asio_stream.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/lib/tls/asio/asio_stream.h b/src/lib/tls/asio/asio_stream.h
index 4d2de0967..37f031571 100644
--- a/src/lib/tls/asio/asio_stream.h
+++ b/src/lib/tls/asio/asio_stream.h
@@ -113,7 +113,12 @@ class Stream
lowest_layer_type& lowest_layer() { return m_nextLayer.lowest_layer(); }
const lowest_layer_type& lowest_layer() const { return m_nextLayer.lowest_layer(); }
- native_handle_type native_handle() { return m_native_handle.get(); }
+ native_handle_type native_handle()
+ {
+ if(m_native_handle == nullptr)
+ { throw Invalid_State("Invalid handshake state"); }
+ return m_native_handle.get();
+ }
//! @}
//! \name configuration and callback setters