@@ -86,23 +86,29 @@ class basic_connection {
8686 using other = basic_connection<Executor1>;
8787 };
8888
89- // / Contructs from an executor.
89+ /* * @brief Constructor
90+ *
91+ * @param ex Executor on which connection operation will run.
92+ * @param ctx SSL context.
93+ * @param max_read_size Maximum read size that is passed to
94+ * the internal `asio::dynamic_buffer` constructor.
95+ */
9096 explicit
9197 basic_connection (
9298 executor_type ex,
93- asio::ssl::context::method method = asio::ssl::context::tls_client ,
99+ asio::ssl::context ctx = asio::ssl::context{asio::ssl::context::tlsv12_client} ,
94100 std::size_t max_read_size = (std::numeric_limits<std::size_t >::max)())
95- : impl_{ex, method , max_read_size}
101+ : impl_{ex, std::move (ctx) , max_read_size}
96102 , timer_{ex}
97103 { }
98104
99105 // / Contructs from a context.
100106 explicit
101107 basic_connection (
102108 asio::io_context& ioc,
103- asio::ssl::context::method method = asio::ssl::context::tls_client ,
109+ asio::ssl::context ctx = asio::ssl::context{asio::ssl::context::tlsv12_client} ,
104110 std::size_t max_read_size = (std::numeric_limits<std::size_t >::max)())
105- : basic_connection(ioc.get_executor(), method , max_read_size)
111+ : basic_connection(ioc.get_executor(), std::move(ctx) , max_read_size)
106112 { }
107113
108114 /* * @brief Starts underlying connection operations.
@@ -286,10 +292,6 @@ class basic_connection {
286292 auto const & get_ssl_context () const noexcept
287293 { return impl_.get_ssl_context ();}
288294
289- // / Returns the ssl context.
290- auto & get_ssl_context () noexcept
291- { return impl_.get_ssl_context ();}
292-
293295 // / Resets the underlying stream.
294296 void reset_stream ()
295297 { impl_.reset_stream (); }
@@ -343,14 +345,14 @@ class connection {
343345 explicit
344346 connection (
345347 executor_type ex,
346- asio::ssl::context::method method = asio::ssl::context::tls_client ,
348+ asio::ssl::context ctx = asio::ssl::context{asio::ssl::context::tlsv12_client} ,
347349 std::size_t max_read_size = (std::numeric_limits<std::size_t >::max)());
348350
349351 // / Contructs from a context.
350352 explicit
351353 connection (
352354 asio::io_context& ioc,
353- asio::ssl::context::method method = asio::ssl::context::tls_client ,
355+ asio::ssl::context ctx = asio::ssl::context{asio::ssl::context::tlsv12_client} ,
354356 std::size_t max_read_size = (std::numeric_limits<std::size_t >::max)());
355357
356358 // / Returns the underlying executor.
@@ -427,10 +429,6 @@ class connection {
427429 auto const & get_ssl_context () const noexcept
428430 { return impl_.get_ssl_context ();}
429431
430- // / Returns the ssl context.
431- auto & get_ssl_context () noexcept
432- { return impl_.get_ssl_context ();}
433-
434432private:
435433 void
436434 async_run_impl (
0 commit comments