Imported Upstream version 1.64.0
[platform/upstream/boost.git] / doc / html / boost_asio / reference / ssl__stream.html
1 <html>
2 <head>
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">
11 </head>
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>
20 </tr></table>
21 <hr>
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>
24 </div>
25 <div class="section">
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>
29 <p>
30         Provides stream-oriented functionality using SSL.
31       </p>
32 <pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span>
33     <span class="keyword">typename</span> <span class="identifier">Stream</span><span class="special">&gt;</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>
37 </pre>
38 <h5>
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>
41       </h5>
42 <div class="informaltable"><table class="table">
43 <colgroup>
44 <col>
45 <col>
46 </colgroup>
47 <thead><tr>
48 <th>
49                 <p>
50                   Name
51                 </p>
52               </th>
53 <th>
54                 <p>
55                   Description
56                 </p>
57               </th>
58 </tr></thead>
59 <tbody>
60 <tr>
61 <td>
62                 <p>
63                   <a class="link" href="ssl__stream__impl_struct.html" title="ssl::stream::impl_struct"><span class="bold"><strong>impl_struct</strong></span></a>
64                 </p>
65               </td>
66 <td>
67                 <p>
68                   Structure for use with deprecated impl_type.
69                 </p>
70               </td>
71 </tr>
72 <tr>
73 <td>
74                 <p>
75                   <a class="link" href="ssl__stream/handshake_type.html" title="ssl::stream::handshake_type"><span class="bold"><strong>handshake_type</strong></span></a>
76                 </p>
77               </td>
78 <td>
79                 <p>
80                   Different handshake types.
81                 </p>
82               </td>
83 </tr>
84 <tr>
85 <td>
86                 <p>
87                   <a class="link" href="ssl__stream/impl_type.html" title="ssl::stream::impl_type"><span class="bold"><strong>impl_type</strong></span></a>
88                 </p>
89               </td>
90 <td>
91                 <p>
92                   (Deprecated: Use native_handle_type.) The underlying implementation
93                   type.
94                 </p>
95               </td>
96 </tr>
97 <tr>
98 <td>
99                 <p>
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>
101                 </p>
102               </td>
103 <td>
104                 <p>
105                   The type of the lowest layer.
106                 </p>
107               </td>
108 </tr>
109 <tr>
110 <td>
111                 <p>
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>
113                 </p>
114               </td>
115 <td>
116                 <p>
117                   The native handle type of the SSL stream.
118                 </p>
119               </td>
120 </tr>
121 <tr>
122 <td>
123                 <p>
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>
125                 </p>
126               </td>
127 <td>
128                 <p>
129                   The type of the next layer.
130                 </p>
131               </td>
132 </tr>
133 </tbody>
134 </table></div>
135 <h5>
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
138         Functions</a>
139       </h5>
140 <div class="informaltable"><table class="table">
141 <colgroup>
142 <col>
143 <col>
144 </colgroup>
145 <thead><tr>
146 <th>
147                 <p>
148                   Name
149                 </p>
150               </th>
151 <th>
152                 <p>
153                   Description
154                 </p>
155               </th>
156 </tr></thead>
157 <tbody>
158 <tr>
159 <td>
160                 <p>
161                   <a class="link" href="ssl__stream/async_handshake.html" title="ssl::stream::async_handshake"><span class="bold"><strong>async_handshake</strong></span></a>
162                 </p>
163               </td>
164 <td>
165                 <p>
166                   Start an asynchronous SSL handshake.
167                 </p>
168               </td>
169 </tr>
170 <tr>
171 <td>
172                 <p>
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>
174                 </p>
175               </td>
176 <td>
177                 <p>
178                   Start an asynchronous read.
179                 </p>
180               </td>
181 </tr>
182 <tr>
183 <td>
184                 <p>
185                   <a class="link" href="ssl__stream/async_shutdown.html" title="ssl::stream::async_shutdown"><span class="bold"><strong>async_shutdown</strong></span></a>
186                 </p>
187               </td>
188 <td>
189                 <p>
190                   Asynchronously shut down SSL on the stream.
191                 </p>
192               </td>
193 </tr>
194 <tr>
195 <td>
196                 <p>
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>
198                 </p>
199               </td>
200 <td>
201                 <p>
202                   Start an asynchronous write.
203                 </p>
204               </td>
205 </tr>
206 <tr>
207 <td>
208                 <p>
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>
210                 </p>
211               </td>
212 <td>
213                 <p>
214                   Get the io_service associated with the object.
215                 </p>
216               </td>
217 </tr>
218 <tr>
219 <td>
220                 <p>
221                   <a class="link" href="ssl__stream/handshake.html" title="ssl::stream::handshake"><span class="bold"><strong>handshake</strong></span></a>
222                 </p>
223               </td>
224 <td>
225                 <p>
226                   Perform SSL handshaking.
227                 </p>
228               </td>
229 </tr>
230 <tr>
231 <td>
232                 <p>
233                   <a class="link" href="ssl__stream/impl.html" title="ssl::stream::impl"><span class="bold"><strong>impl</strong></span></a>
234                 </p>
235               </td>
236 <td>
237                 <p>
238                   (Deprecated: Use native_handle().) Get the underlying implementation
239                   in the native type.
240                 </p>
241               </td>
242 </tr>
243 <tr>
244 <td>
245                 <p>
246                   <a class="link" href="ssl__stream/lowest_layer.html" title="ssl::stream::lowest_layer"><span class="bold"><strong>lowest_layer</strong></span></a>
247                 </p>
248               </td>
249 <td>
250                 <p>
251                   Get a reference to the lowest layer.
252                 </p>
253               </td>
254 </tr>
255 <tr>
256 <td>
257                 <p>
258                   <a class="link" href="ssl__stream/native_handle.html" title="ssl::stream::native_handle"><span class="bold"><strong>native_handle</strong></span></a>
259                 </p>
260               </td>
261 <td>
262                 <p>
263                   Get the underlying implementation in the native type.
264                 </p>
265               </td>
266 </tr>
267 <tr>
268 <td>
269                 <p>
270                   <a class="link" href="ssl__stream/next_layer.html" title="ssl::stream::next_layer"><span class="bold"><strong>next_layer</strong></span></a>
271                 </p>
272               </td>
273 <td>
274                 <p>
275                   Get a reference to the next layer.
276                 </p>
277               </td>
278 </tr>
279 <tr>
280 <td>
281                 <p>
282                   <a class="link" href="ssl__stream/read_some.html" title="ssl::stream::read_some"><span class="bold"><strong>read_some</strong></span></a>
283                 </p>
284               </td>
285 <td>
286                 <p>
287                   Read some data from the stream.
288                 </p>
289               </td>
290 </tr>
291 <tr>
292 <td>
293                 <p>
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>
295                 </p>
296               </td>
297 <td>
298                 <p>
299                   Set the callback used to verify peer certificates.
300                 </p>
301               </td>
302 </tr>
303 <tr>
304 <td>
305                 <p>
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>
307                 </p>
308               </td>
309 <td>
310                 <p>
311                   Set the peer verification depth.
312                 </p>
313               </td>
314 </tr>
315 <tr>
316 <td>
317                 <p>
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>
319                 </p>
320               </td>
321 <td>
322                 <p>
323                   Set the peer verification mode.
324                 </p>
325               </td>
326 </tr>
327 <tr>
328 <td>
329                 <p>
330                   <a class="link" href="ssl__stream/shutdown.html" title="ssl::stream::shutdown"><span class="bold"><strong>shutdown</strong></span></a>
331                 </p>
332               </td>
333 <td>
334                 <p>
335                   Shut down SSL on the stream.
336                 </p>
337               </td>
338 </tr>
339 <tr>
340 <td>
341                 <p>
342                   <a class="link" href="ssl__stream/stream.html" title="ssl::stream::stream"><span class="bold"><strong>stream</strong></span></a>
343                 </p>
344               </td>
345 <td>
346                 <p>
347                   Construct a stream.
348                 </p>
349               </td>
350 </tr>
351 <tr>
352 <td>
353                 <p>
354                   <a class="link" href="ssl__stream/write_some.html" title="ssl::stream::write_some"><span class="bold"><strong>write_some</strong></span></a>
355                 </p>
356               </td>
357 <td>
358                 <p>
359                   Write some data to the stream.
360                 </p>
361               </td>
362 </tr>
363 <tr>
364 <td>
365                 <p>
366                   <a class="link" href="ssl__stream/_stream.html" title="ssl::stream::~stream"><span class="bold"><strong>~stream</strong></span></a>
367                 </p>
368               </td>
369 <td>
370                 <p>
371                   Destructor.
372                 </p>
373               </td>
374 </tr>
375 </tbody>
376 </table></div>
377 <p>
378         The stream class template provides asynchronous and blocking stream-oriented
379         functionality using SSL.
380       </p>
381 <h5>
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
384         Safety</a>
385       </h5>
386 <p>
387         <span class="emphasis"><em>Distinct</em></span> <span class="emphasis"><em>objects:</em></span> Safe.
388       </p>
389 <p>
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.
393       </p>
394 <h5>
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>
397       </h5>
398 <p>
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:
400       </p>
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">&lt;</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">&gt;</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>
404 </pre>
405 <h5>
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>
408       </h5>
409 <p>
410         <span class="emphasis"><em>Header: </em></span><code class="literal">boost/asio/ssl/stream.hpp</code>
411       </p>
412 <p>
413         <span class="emphasis"><em>Convenience header: </em></span><code class="literal">boost/asio/ssl.hpp</code>
414       </p>
415 </div>
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 &#169; 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>)
421       </p>
422 </div></td>
423 </tr></table>
424 <hr>
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>
427 </div>
428 </body>
429 </html>