Realistic 3D camera system
3D camera system components
Public Types | Public Member Functions | List of all members
asio::ssl::rfc2818_verification Class Reference

#include <rfc2818_verification.hpp>

Public Types

typedef bool result_type
 The type of the function object's result. More...
 

Public Member Functions

 rfc2818_verification (const std::string &host)
 Constructor. More...
 
ASIO_DECL bool operator() (bool preverified, verify_context &ctx) const
 Perform certificate verification. More...
 

Detailed Description

Verifies a certificate against a hostname according to the rules described in RFC 2818.

Example
The following example shows how to synchronously open a secure connection to a given host name:
namespace ssl = asio::ssl;
typedef ssl::stream<tcp::socket> ssl_socket;
// Create a context that uses the default paths for finding CA certificates.
ssl::context ctx(ssl::context::sslv23);
ctx.set_default_verify_paths();
// Open a socket and connect it to the remote host.
asio::io_service io_service;
ssl_socket sock(io_service, ctx);
tcp::resolver resolver(io_service);
tcp::resolver::query query("host.name", "https");
asio::connect(sock.lowest_layer(), resolver.resolve(query));
sock.lowest_layer().set_option(tcp::no_delay(true));
// Perform SSL handshake and verify the remote host's certificate.
sock.set_verify_mode(ssl::verify_peer);
sock.set_verify_callback(ssl::rfc2818_verification("host.name"));
sock.handshake(ssl_socket::client);
// ... read and write as normal ...

Definition at line 64 of file rfc2818_verification.hpp.

Member Typedef Documentation

The type of the function object's result.

Definition at line 68 of file rfc2818_verification.hpp.

Constructor & Destructor Documentation

asio::ssl::rfc2818_verification::rfc2818_verification ( const std::string &  host)
inlineexplicit

Constructor.

Definition at line 71 of file rfc2818_verification.hpp.

Member Function Documentation

bool asio::ssl::rfc2818_verification::operator() ( bool  preverified,
verify_context ctx 
) const

Perform certificate verification.

Definition at line 35 of file rfc2818_verification.ipp.


The documentation for this class was generated from the following files: