From 1e781cb19817dbe307dec3ae48d1b461d18eaeef Mon Sep 17 00:00:00 2001
From: DraconPern <draconpern@hotmail.com>
Date: Mon, 15 Nov 2021 06:23:00 -0600
Subject: [PATCH 1/2] add lowest_layer() that's also present in ssl::stream

---
 include/boost/wintls/stream.hpp | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/include/boost/wintls/stream.hpp b/include/boost/wintls/stream.hpp
index 46f4f241..e22433a7 100644
--- a/include/boost/wintls/stream.hpp
+++ b/include/boost/wintls/stream.hpp
@@ -43,6 +43,9 @@ class stream {
   /// The type of the next layer.
   using next_layer_type = typename std::remove_reference<NextLayer>::type;
 
+  /// The type of the lowest layer.
+  typedef typename next_layer_type::lowest_layer_type lowest_layer_type;
+
   /// The type of the executor associated with the object.
   using executor_type = typename std::remove_reference<next_layer_type>::type::executor_type;
 
@@ -100,6 +103,32 @@ class stream {
     return next_layer_;
   }
 
+  /// Get a reference to the lowest layer.
+  /**
+   * This function returns a reference to the lowest layer in a stack of
+   * stream layers.
+   *
+   * @return A reference to the lowest layer in the stack of stream layers.
+   * Ownership is not transferred to the caller.
+   */
+  lowest_layer_type& lowest_layer()
+  {
+	  return next_layer_.lowest_layer();
+  }
+
+  /// Get a reference to the lowest layer.
+  /**
+   * This function returns a reference to the lowest layer in a stack of
+   * stream layers.
+   *
+   * @return A reference to the lowest layer in the stack of stream layers.
+   * Ownership is not transferred to the caller.
+   */
+  const lowest_layer_type& lowest_layer() const
+  {
+	  return next_layer_.lowest_layer();
+  }
+
   /** Set SNI hostname
    *
    * Sets the SNI hostname the client will use for requesting and

From dd1c7e7df8fcdbd7fed690943e8a3ad727f9cee7 Mon Sep 17 00:00:00 2001
From: DraconPern <draconpern@hotmail.com>
Date: Mon, 15 Nov 2021 17:41:37 -0600
Subject: [PATCH 2/2] add BOOST_ASIO_NO_EXTENSIONS guard ala basic_socket

---
 include/boost/wintls/stream.hpp | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/include/boost/wintls/stream.hpp b/include/boost/wintls/stream.hpp
index e22433a7..47fe57f4 100644
--- a/include/boost/wintls/stream.hpp
+++ b/include/boost/wintls/stream.hpp
@@ -43,8 +43,10 @@ class stream {
   /// The type of the next layer.
   using next_layer_type = typename std::remove_reference<NextLayer>::type;
 
+#if !defined(BOOST_ASIO_NO_EXTENSIONS)
   /// The type of the lowest layer.
   typedef typename next_layer_type::lowest_layer_type lowest_layer_type;
+#endif
 
   /// The type of the executor associated with the object.
   using executor_type = typename std::remove_reference<next_layer_type>::type::executor_type;
@@ -103,6 +105,7 @@ class stream {
     return next_layer_;
   }
 
+#if !defined(BOOST_ASIO_NO_EXTENSIONS)
   /// Get a reference to the lowest layer.
   /**
    * This function returns a reference to the lowest layer in a stack of
@@ -128,6 +131,7 @@ class stream {
   {
 	  return next_layer_.lowest_layer();
   }
+#endif
 
   /** Set SNI hostname
    *