3 <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
4 <title>ssl::stream</title>
5 <link rel="stylesheet" href="../../../../doc/src/boostbook.css" type="text/css">
6 <meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
7 <link rel="home" href="../../boost_asio.html" title="Boost.Asio">
8 <link rel="up" href="../reference.html" title="Reference">
9 <link rel="prev" href="ssl__rfc2818_verification/rfc2818_verification.html" title="ssl::rfc2818_verification::rfc2818_verification">
10 <link rel="next" href="ssl__stream/async_handshake.html" title="ssl::stream::async_handshake">
12 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
13 <table cellpadding="2" width="100%"><tr>
14 <td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../boost.png"></td>
15 <td align="center"><a href="../../../../index.html">Home</a></td>
16 <td align="center"><a href="../../../../libs/libraries.htm">Libraries</a></td>
17 <td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
18 <td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
19 <td align="center"><a href="../../../../more/index.htm">More</a></td>
22 <div class="spirit-nav">
23 <a accesskey="p" href="ssl__rfc2818_verification/rfc2818_verification.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../boost_asio.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="ssl__stream/async_handshake.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
26 <div class="titlepage"><div><div><h3 class="title">
27 <a name="boost_asio.reference.ssl__stream"></a><a class="link" href="ssl__stream.html" title="ssl::stream">ssl::stream</a>
28 </h3></div></div></div>
30 Provides stream-oriented functionality using SSL.
32 <pre class="programlisting"><span class="keyword">template</span><span class="special"><</span>
33 <span class="keyword">typename</span> <span class="identifier">Stream</span><span class="special">></span>
34 <span class="keyword">class</span> <span class="identifier">stream</span> <span class="special">:</span>
35 <span class="keyword">public</span> <span class="identifier">ssl</span><span class="special">::</span><span class="identifier">stream_base</span><span class="special">,</span>
36 <span class="identifier">noncopyable</span>
39 <a name="boost_asio.reference.ssl__stream.h0"></a>
40 <span class="phrase"><a name="boost_asio.reference.ssl__stream.types"></a></span><a class="link" href="ssl__stream.html#boost_asio.reference.ssl__stream.types">Types</a>
42 <div class="informaltable"><table class="table">
63 <a class="link" href="ssl__stream__impl_struct.html" title="ssl::stream::impl_struct"><span class="bold"><strong>impl_struct</strong></span></a>
68 Structure for use with deprecated impl_type.
75 <a class="link" href="ssl__stream/handshake_type.html" title="ssl::stream::handshake_type"><span class="bold"><strong>handshake_type</strong></span></a>
80 Different handshake types.
87 <a class="link" href="ssl__stream/impl_type.html" title="ssl::stream::impl_type"><span class="bold"><strong>impl_type</strong></span></a>
92 (Deprecated: Use native_handle_type.) The underlying implementation
100 <a class="link" href="ssl__stream/lowest_layer_type.html" title="ssl::stream::lowest_layer_type"><span class="bold"><strong>lowest_layer_type</strong></span></a>
105 The type of the lowest layer.
112 <a class="link" href="ssl__stream/native_handle_type.html" title="ssl::stream::native_handle_type"><span class="bold"><strong>native_handle_type</strong></span></a>
117 The native handle type of the SSL stream.
124 <a class="link" href="ssl__stream/next_layer_type.html" title="ssl::stream::next_layer_type"><span class="bold"><strong>next_layer_type</strong></span></a>
129 The type of the next layer.
136 <a name="boost_asio.reference.ssl__stream.h1"></a>
137 <span class="phrase"><a name="boost_asio.reference.ssl__stream.member_functions"></a></span><a class="link" href="ssl__stream.html#boost_asio.reference.ssl__stream.member_functions">Member
140 <div class="informaltable"><table class="table">
161 <a class="link" href="ssl__stream/async_handshake.html" title="ssl::stream::async_handshake"><span class="bold"><strong>async_handshake</strong></span></a>
166 Start an asynchronous SSL handshake.
173 <a class="link" href="ssl__stream/async_read_some.html" title="ssl::stream::async_read_some"><span class="bold"><strong>async_read_some</strong></span></a>
178 Start an asynchronous read.
185 <a class="link" href="ssl__stream/async_shutdown.html" title="ssl::stream::async_shutdown"><span class="bold"><strong>async_shutdown</strong></span></a>
190 Asynchronously shut down SSL on the stream.
197 <a class="link" href="ssl__stream/async_write_some.html" title="ssl::stream::async_write_some"><span class="bold"><strong>async_write_some</strong></span></a>
202 Start an asynchronous write.
209 <a class="link" href="ssl__stream/get_io_service.html" title="ssl::stream::get_io_service"><span class="bold"><strong>get_io_service</strong></span></a>
214 Get the io_service associated with the object.
221 <a class="link" href="ssl__stream/handshake.html" title="ssl::stream::handshake"><span class="bold"><strong>handshake</strong></span></a>
226 Perform SSL handshaking.
233 <a class="link" href="ssl__stream/impl.html" title="ssl::stream::impl"><span class="bold"><strong>impl</strong></span></a>
238 (Deprecated: Use native_handle().) Get the underlying implementation
246 <a class="link" href="ssl__stream/lowest_layer.html" title="ssl::stream::lowest_layer"><span class="bold"><strong>lowest_layer</strong></span></a>
251 Get a reference to the lowest layer.
258 <a class="link" href="ssl__stream/native_handle.html" title="ssl::stream::native_handle"><span class="bold"><strong>native_handle</strong></span></a>
263 Get the underlying implementation in the native type.
270 <a class="link" href="ssl__stream/next_layer.html" title="ssl::stream::next_layer"><span class="bold"><strong>next_layer</strong></span></a>
275 Get a reference to the next layer.
282 <a class="link" href="ssl__stream/read_some.html" title="ssl::stream::read_some"><span class="bold"><strong>read_some</strong></span></a>
287 Read some data from the stream.
294 <a class="link" href="ssl__stream/set_verify_callback.html" title="ssl::stream::set_verify_callback"><span class="bold"><strong>set_verify_callback</strong></span></a>
299 Set the callback used to verify peer certificates.
306 <a class="link" href="ssl__stream/set_verify_depth.html" title="ssl::stream::set_verify_depth"><span class="bold"><strong>set_verify_depth</strong></span></a>
311 Set the peer verification depth.
318 <a class="link" href="ssl__stream/set_verify_mode.html" title="ssl::stream::set_verify_mode"><span class="bold"><strong>set_verify_mode</strong></span></a>
323 Set the peer verification mode.
330 <a class="link" href="ssl__stream/shutdown.html" title="ssl::stream::shutdown"><span class="bold"><strong>shutdown</strong></span></a>
335 Shut down SSL on the stream.
342 <a class="link" href="ssl__stream/stream.html" title="ssl::stream::stream"><span class="bold"><strong>stream</strong></span></a>
354 <a class="link" href="ssl__stream/write_some.html" title="ssl::stream::write_some"><span class="bold"><strong>write_some</strong></span></a>
359 Write some data to the stream.
366 <a class="link" href="ssl__stream/_stream.html" title="ssl::stream::~stream"><span class="bold"><strong>~stream</strong></span></a>
378 The stream class template provides asynchronous and blocking stream-oriented
379 functionality using SSL.
382 <a name="boost_asio.reference.ssl__stream.h2"></a>
383 <span class="phrase"><a name="boost_asio.reference.ssl__stream.thread_safety"></a></span><a class="link" href="ssl__stream.html#boost_asio.reference.ssl__stream.thread_safety">Thread
387 <span class="emphasis"><em>Distinct</em></span> <span class="emphasis"><em>objects:</em></span> Safe.
390 <span class="emphasis"><em>Shared</em></span> <span class="emphasis"><em>objects:</em></span> Unsafe. The application
391 must also ensure that all asynchronous operations are performed within the
392 same implicit or explicit strand.
395 <a name="boost_asio.reference.ssl__stream.h3"></a>
396 <span class="phrase"><a name="boost_asio.reference.ssl__stream.example"></a></span><a class="link" href="ssl__stream.html#boost_asio.reference.ssl__stream.example">Example</a>
399 To use the SSL stream template with an <code class="computeroutput"><span class="identifier">ip</span><span class="special">::</span><span class="identifier">tcp</span><span class="special">::</span><span class="identifier">socket</span></code>, you would write:
401 <pre class="programlisting"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">asio</span><span class="special">::</span><span class="identifier">io_service</span> <span class="identifier">io_service</span><span class="special">;</span>
402 <span class="identifier">boost</span><span class="special">::</span><span class="identifier">asio</span><span class="special">::</span><span class="identifier">ssl</span><span class="special">::</span><span class="identifier">context</span> <span class="identifier">ctx</span><span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">asio</span><span class="special">::</span><span class="identifier">ssl</span><span class="special">::</span><span class="identifier">context</span><span class="special">::</span><span class="identifier">sslv23</span><span class="special">);</span>
403 <span class="identifier">boost</span><span class="special">::</span><span class="identifier">asio</span><span class="special">::</span><span class="identifier">ssl</span><span class="special">::</span><span class="identifier">stream</span><span class="special"><</span><span class="identifier">asio</span><span class="special">:</span><span class="identifier">ip</span><span class="special">::</span><span class="identifier">tcp</span><span class="special">::</span><span class="identifier">socket</span><span class="special">></span> <span class="identifier">sock</span><span class="special">(</span><span class="identifier">io_service</span><span class="special">,</span> <span class="identifier">ctx</span><span class="special">);</span>
406 <a name="boost_asio.reference.ssl__stream.h4"></a>
407 <span class="phrase"><a name="boost_asio.reference.ssl__stream.requirements"></a></span><a class="link" href="ssl__stream.html#boost_asio.reference.ssl__stream.requirements">Requirements</a>
410 <span class="emphasis"><em>Header: </em></span><code class="literal">boost/asio/ssl/stream.hpp</code>
413 <span class="emphasis"><em>Convenience header: </em></span><code class="literal">boost/asio/ssl.hpp</code>
416 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
417 <td align="left"></td>
418 <td align="right"><div class="copyright-footer">Copyright © 2003-2017 Christopher M. Kohlhoff<p>
419 Distributed under the Boost Software License, Version 1.0. (See accompanying
420 file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
425 <div class="spirit-nav">
426 <a accesskey="p" href="ssl__rfc2818_verification/rfc2818_verification.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../boost_asio.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="ssl__stream/async_handshake.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>