rippled
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
ripple::HTTPClientSSLContext Class Reference

#include <HTTPClientSSLContext.h>

Collaboration diagram for ripple::HTTPClientSSLContext:
Collaboration graph
[legend]

Public Member Functions

 HTTPClientSSLContext (std::string const &sslVerifyDir, std::string const &sslVerifyFile, bool sslVerify, 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.
 
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.
 

Static Public Member Functions

static bool rfc6125_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 host_name_verification (rfc6125) implementation.
 

Private Attributes

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

Detailed Description

Definition at line 35 of file HTTPClientSSLContext.h.

Constructor & Destructor Documentation

◆ HTTPClientSSLContext()

ripple::HTTPClientSSLContext::HTTPClientSSLContext ( std::string const &  sslVerifyDir,
std::string const &  sslVerifyFile,
bool  sslVerify,
beast::Journal  j,
boost::asio::ssl::context_base::method  method = boost::asio::ssl::context::sslv23 
)
explicit

Definition at line 38 of file HTTPClientSSLContext.h.

Member Function Documentation

◆ context()

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

Definition at line 75 of file HTTPClientSSLContext.h.

◆ sslVerify()

bool ripple::HTTPClientSSLContext::sslVerify ( ) const

Definition at line 81 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 110 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 145 of file HTTPClientSSLContext.h.

◆ rfc6125_verify()

static bool ripple::HTTPClientSSLContext::rfc6125_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 host_name_verification (rfc6125) implementation.

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

Definition at line 178 of file HTTPClientSSLContext.h.

Member Data Documentation

◆ ssl_context_

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

Definition at line 193 of file HTTPClientSSLContext.h.

◆ j_

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

Definition at line 194 of file HTTPClientSSLContext.h.

◆ verify_

bool const ripple::HTTPClientSSLContext::verify_
private

Definition at line 195 of file HTTPClientSSLContext.h.