SWC-DB  v0.5.12 C++ documentations
SWC-DB© (Super Wide Column Database) - High Performance Scalable Database (https://github.com/kashirin-alex/swc-db)
SWC::Comm::ConfigSSL Class Referencefinal

#include <swcdb/core/comm/ConfigSSL.h>

+ Collaboration diagram for SWC::Comm::ConfigSSL:

Public Member Functions

 ConfigSSL (const Config::Settings &settings, bool is_client=true)
 
 ~ConfigSSL () noexcept
 
void set_networks (const Config::Strings &networks, bool with_local)
 
SWC_CAN_INLINE bool need_ssl (const EndPoint &remote) const noexcept
 
SWC_CAN_INLINE bool need_ssl (const EndPoint &local, const EndPoint &remote) const noexcept
 
ConnHandlerSSL::Ptr make_connection (AppContext::Ptr &app_ctx, SocketPlain &socket) const
 
ConnHandlerSSL::Ptr make_client (AppContext::Ptr &app_ctx, SocketPlain &socket) const
 
ConnHandlerPtr make_client (AppContext::Ptr &app_ctx, SocketPlain &socket, asio::error_code &ec) const
 

Private Member Functions

void load_file (const std::string &pathbase, std::string filepath, std::string &to) const
 

Private Attributes

Networks_v4 nets_v4
 
Networks_v6 nets_v6
 
std::string subject_name
 
asio::ssl::context ctx
 

Detailed Description

Definition at line 18 of file ConfigSSL.h.

Constructor & Destructor Documentation

◆ ConfigSSL()

SWC_SHOULD_NOT_INLINE SWC::Comm::ConfigSSL::ConfigSSL ( const Config::Settings settings,
bool  is_client = true 
)

Definition at line 15 of file ConfigSSL.cc.

References ctx, SWC::Config::Properties::get_str(), SWC::Config::Properties::get_strs(), SWC::Config::Properties::has(), load_file(), set_networks(), and subject_name.

+ Here is the call graph for this function:

◆ ~ConfigSSL()

SWC::Comm::ConfigSSL::~ConfigSSL ( )
inlinenoexcept

Definition at line 23 of file ConfigSSL.h.

Member Function Documentation

◆ load_file()

void SWC::Comm::ConfigSSL::load_file ( const std::string &  pathbase,
std::string  filepath,
std::string &  to 
) const
private

Definition at line 133 of file ConfigSSL.cc.

References SWC::Error::Exception::code(), SWC::Error::CONFIG_BAD_CFG_FILE, SWC::Error::CONFIG_BAD_VALUE, SWC::Common::Files::Schema::filepath(), SWC::Error::get_text(), SWC::Error::OK, SWC_CURRENT_EXCEPTION, and SWC_THROWF.

Referenced by ConfigSSL().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ make_client() [1/2]

ConnHandlerSSL::Ptr SWC::Comm::ConfigSSL::make_client ( AppContext::Ptr app_ctx,
SocketPlain socket 
) const

Definition at line 116 of file ConfigSSL.cc.

References make_connection(), and subject_name.

Referenced by make_client().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ make_client() [2/2]

ConnHandlerPtr SWC::Comm::ConfigSSL::make_client ( AppContext::Ptr app_ctx,
SocketPlain socket,
asio::error_code &  ec 
) const

Definition at line 125 of file ConfigSSL.cc.

References make_client().

+ Here is the call graph for this function:

◆ make_connection()

ConnHandlerSSL::Ptr SWC::Comm::ConfigSSL::make_connection ( AppContext::Ptr app_ctx,
SocketPlain socket 
) const
inline

Definition at line 39 of file ConfigSSL.h.

References ctx, and SWC::Comm::ConnHandlerSSL::make().

Referenced by make_client(), and SWC::Comm::server::Acceptor::Mixed::operator()().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ need_ssl() [1/2]

SWC_CAN_INLINE bool SWC::Comm::ConfigSSL::need_ssl ( const EndPoint local,
const EndPoint remote 
) const
inlinenoexcept

Definition at line 33 of file ConfigSSL.h.

References need_ssl().

+ Here is the call graph for this function:

◆ need_ssl() [2/2]

SWC_CAN_INLINE bool SWC::Comm::ConfigSSL::need_ssl ( const EndPoint remote) const
inlinenoexcept

Definition at line 28 of file ConfigSSL.h.

References SWC::Comm::Resolver::is_network(), nets_v4, and nets_v6.

Referenced by need_ssl(), SWC::Comm::server::Acceptor::Mixed::operator()(), and SWC::Comm::server::SerializedServer::SerializedServer().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ set_networks()

void SWC::Comm::ConfigSSL::set_networks ( const Config::Strings networks,
bool  with_local 
)

Definition at line 88 of file ConfigSSL.cc.

References SWC::Error::CONFIG_BAD_VALUE, SWC::Comm::Resolver::get_local_networks(), SWC::Comm::Resolver::get_networks(), SWC::Error::get_text(), nets_v4, nets_v6, SWC::Error::OK, and SWC_THROWF.

Referenced by ConfigSSL().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ ctx

asio::ssl::context SWC::Comm::ConfigSSL::ctx
mutableprivate

Definition at line 58 of file ConfigSSL.h.

Referenced by ConfigSSL(), and make_connection().

◆ nets_v4

Networks_v4 SWC::Comm::ConfigSSL::nets_v4
private

Definition at line 55 of file ConfigSSL.h.

Referenced by need_ssl(), and set_networks().

◆ nets_v6

Networks_v6 SWC::Comm::ConfigSSL::nets_v6
private

Definition at line 56 of file ConfigSSL.h.

Referenced by need_ssl(), and set_networks().

◆ subject_name

std::string SWC::Comm::ConfigSSL::subject_name
private

Definition at line 57 of file ConfigSSL.h.

Referenced by ConfigSSL(), and make_client().


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