3 <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
4 <title>ssl_stream::native_handle</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="../../../index.html" title="Chapter 1. Boost.Beast">
8 <link rel="up" href="../boost__beast__ssl_stream.html" title="ssl_stream">
9 <link rel="prev" href="impl_struct.html" title="ssl_stream::impl_struct">
10 <link rel="next" href="native_handle_type.html" title="ssl_stream::native_handle_type">
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="impl_struct.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../boost__beast__ssl_stream.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="native_handle_type.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
26 <div class="titlepage"><div><div><h5 class="title">
27 <a name="beast.ref.boost__beast__ssl_stream.native_handle"></a><a class="link" href="native_handle.html" title="ssl_stream::native_handle">ssl_stream::native_handle</a>
28 </h5></div></div></div>
30 <a class="indexterm" name="idm45873483879152"></a>
31 Get the underlying implementation in the native
35 <a name="beast.ref.boost__beast__ssl_stream.native_handle.h0"></a>
36 <span class="phrase"><a name="beast.ref.boost__beast__ssl_stream.native_handle.synopsis"></a></span><a class="link" href="native_handle.html#beast.ref.boost__beast__ssl_stream.native_handle.synopsis">Synopsis</a>
38 <pre class="programlisting"><span class="identifier">native_handle_type</span>
39 <span class="identifier">native_handle</span><span class="special">();</span>
42 <a name="beast.ref.boost__beast__ssl_stream.native_handle.h1"></a>
43 <span class="phrase"><a name="beast.ref.boost__beast__ssl_stream.native_handle.description"></a></span><a class="link" href="native_handle.html#beast.ref.boost__beast__ssl_stream.native_handle.description">Description</a>
46 This function may be used to obtain the underlying implementation of the
47 context. This is intended to allow access to context functionality that
48 is not otherwise provided.
51 <a name="beast.ref.boost__beast__ssl_stream.native_handle.h2"></a>
52 <span class="phrase"><a name="beast.ref.boost__beast__ssl_stream.native_handle.example"></a></span><a class="link" href="native_handle.html#beast.ref.boost__beast__ssl_stream.native_handle.example">Example</a>
55 The <a class="link" href="native_handle.html" title="ssl_stream::native_handle"><code class="computeroutput"><span class="identifier">ssl_stream</span><span class="special">::</span><span class="identifier">native_handle</span><span class="special">()</span></code></a>
56 function returns a pointer of type <code class="computeroutput"><span class="identifier">SSL</span><span class="special">*</span></code> that is suitable for passing to functions
57 such as <code class="computeroutput"><span class="identifier">SSL_get_verify_result</span></code>
58 and <code class="computeroutput"><span class="identifier">SSL_get_peer_certificate</span><span class="special">:</span></code>
60 <pre class="programlisting"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">beast</span><span class="special">::</span><span class="identifier">ssl_stream</span><span class="special"><</span><span class="identifier">net</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">ss</span><span class="special">{</span><span class="identifier">ioc</span><span class="special">,</span> <span class="identifier">ctx</span><span class="special">};</span>
62 <span class="comment">// ... establish connection and perform handshake ...</span>
64 <span class="keyword">if</span> <span class="special">(</span><span class="identifier">X509</span><span class="special">*</span> <span class="identifier">cert</span> <span class="special">=</span> <span class="identifier">SSL_get_peer_certificate</span><span class="special">(</span><span class="identifier">ss</span><span class="special">.</span><span class="identifier">native_handle</span><span class="special">()))</span>
65 <span class="special">{</span>
66 <span class="keyword">if</span> <span class="special">(</span><span class="identifier">SSL_get_verify_result</span><span class="special">(</span><span class="identifier">ss</span><span class="special">.</span><span class="identifier">native_handle</span><span class="special">())</span> <span class="special">==</span> <span class="identifier">X509_V_OK</span><span class="special">)</span>
67 <span class="special">{</span>
68 <span class="comment">// ...</span>
69 <span class="special">}</span>
70 <span class="special">}</span>
73 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
74 <td align="left"></td>
75 <td align="right"><div class="copyright-footer">Copyright © 2016-2019 Vinnie
77 Distributed under the Boost Software License, Version 1.0. (See accompanying
78 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>)
83 <div class="spirit-nav">
84 <a accesskey="p" href="impl_struct.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../boost__beast__ssl_stream.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="native_handle_type.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>