#include <swcdb/core/comm/ConfigSSL.h>
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 |
Definition at line 18 of file ConfigSSL.h.
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.
|
inlinenoexcept |
Definition at line 23 of file ConfigSSL.h.
|
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().
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().
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().
|
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()().
|
inlinenoexcept |
Definition at line 33 of file ConfigSSL.h.
References need_ssl().
|
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().
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().
|
mutableprivate |
Definition at line 58 of file ConfigSSL.h.
Referenced by ConfigSSL(), and make_connection().
|
private |
Definition at line 55 of file ConfigSSL.h.
Referenced by need_ssl(), and set_networks().
|
private |
Definition at line 56 of file ConfigSSL.h.
Referenced by need_ssl(), and set_networks().
|
private |
Definition at line 57 of file ConfigSSL.h.
Referenced by ConfigSSL(), and make_client().