rippled
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
ripple::HTTPClientSSLContext Class Reference
Collaboration diagram for ripple::HTTPClientSSLContext:
Collaboration graph
[legend]

Public Member Functions

 HTTPClientSSLContext (Config const &config, beast::Journal j, boost::asio::ssl::context_base::method method=boost::asio::ssl::context::sslv23)
 
boost::asio::ssl::context & context ()
 
bool sslVerify () const
 
template<class T , class = std::enable_if_t< std::is_same< T, boost::asio::ssl::stream<boost::asio::ip::tcp::socket>>:: value || std::is_same< T, boost::asio::ssl::stream<boost::asio::ip::tcp::socket&>>:: value>>
boost::system::error_code preConnectVerify (T &strm, std::string const &host)
 invoked before connect/async_connect on an ssl stream to setup name verification. More...
 
template<class T , class = std::enable_if_t< std::is_same< T, boost::asio::ssl::stream<boost::asio::ip::tcp::socket>>:: value || std::is_same< T, boost::asio::ssl::stream<boost::asio::ip::tcp::socket&>>:: value>>
boost::system::error_code postConnectVerify (T &strm, std::string const &host)
 invoked after connect/async_connect but before sending data on an ssl stream - to setup name verification. More...
 

Static Public Member Functions

static bool rfc2818_verify (std::string const &domain, bool preverified, boost::asio::ssl::verify_context &ctx, beast::Journal j)
 callback invoked for name verification - just passes through to the asio rfc2818 implementation. More...
 

Private Attributes

boost::asio::ssl::context ssl_context_
 
const beast::Journal j_
 
const bool verify_
 

Detailed Description

Definition at line 34 of file HTTPClientSSLContext.h.

Constructor & Destructor Documentation

◆ HTTPClientSSLContext()

ripple::HTTPClientSSLContext::HTTPClientSSLContext ( Config const &  config,
beast::Journal  j,
boost::asio::ssl::context_base::method  method = boost::asio::ssl::context::sslv23 
)
explicit

Definition at line 37 of file HTTPClientSSLContext.h.

Member Function Documentation

◆ context()

boost::asio::ssl::context& ripple::HTTPClientSSLContext::context ( )

Definition at line 72 of file HTTPClientSSLContext.h.

◆ sslVerify()

bool ripple::HTTPClientSSLContext::sslVerify ( ) const

Definition at line 78 of file HTTPClientSSLContext.h.

◆ preConnectVerify()

template<class T , class = std::enable_if_t< std::is_same< T, boost::asio::ssl::stream<boost::asio::ip::tcp::socket>>:: value || std::is_same< T, boost::asio::ssl::stream<boost::asio::ip::tcp::socket&>>:: value>>
boost::system::error_code ripple::HTTPClientSSLContext::preConnectVerify ( T &  strm,
std::string const &  host 
)

invoked before connect/async_connect on an ssl stream to setup name verification.

If we intend to verify the SSL connection, we need to set the default domain for server name indication prior to connecting

Parameters
strmasio ssl stream
hosthostname to verify
Returns
error_code indicating failures, if any

Definition at line 107 of file HTTPClientSSLContext.h.

◆ postConnectVerify()

template<class T , class = std::enable_if_t< std::is_same< T, boost::asio::ssl::stream<boost::asio::ip::tcp::socket>>:: value || std::is_same< T, boost::asio::ssl::stream<boost::asio::ip::tcp::socket&>>:: value>>
boost::system::error_code ripple::HTTPClientSSLContext::postConnectVerify ( T &  strm,
std::string const &  host 
)

invoked after connect/async_connect but before sending data on an ssl stream - to setup name verification.

Parameters
strmasio ssl stream
hosthostname to verify

Definition at line 142 of file HTTPClientSSLContext.h.

◆ rfc2818_verify()

static bool ripple::HTTPClientSSLContext::rfc2818_verify ( std::string const &  domain,
bool  preverified,
boost::asio::ssl::verify_context &  ctx,
beast::Journal  j 
)
static

callback invoked for name verification - just passes through to the asio rfc2818 implementation.

Parameters
domainhostname expected
preverifiedpassed by implementation
ctxpassed by implementation
jjournal for logging

Definition at line 175 of file HTTPClientSSLContext.h.

Member Data Documentation

◆ ssl_context_

boost::asio::ssl::context ripple::HTTPClientSSLContext::ssl_context_
private

Definition at line 190 of file HTTPClientSSLContext.h.

◆ j_

const beast::Journal ripple::HTTPClientSSLContext::j_
private

Definition at line 191 of file HTTPClientSSLContext.h.

◆ verify_

const bool ripple::HTTPClientSSLContext::verify_
private

Definition at line 192 of file HTTPClientSSLContext.h.