Boost
C++ Libraries
...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
This version of Boost is under active development. You are currently in the develop branch. The current version is 1.90.0.
Get the underlying implementation in the native type.
native_handle_type native_handle();
This function may be used to obtain the underlying implementation of the context. This is intended to allow access to context functionality that is not otherwise provided.
The native_handle()
function returns a pointer of type SSL* that is suitable for passing to functions
such as SSL_get_verify_result
and SSL_get_peer_certificate:
boost::asio::ssl::stream<boost::asio::ip::tcp::socket> sock(io_ctx, ctx); // ... establish connection and perform handshake ... if (X509* cert = SSL_get_peer_certificate(sock.native_handle())) { if (SSL_get_verify_result(sock.native_handle()) == X509_V_OK) { // ... } }