|
SSL_CTX * | getSslCtx () |
|
SSL_CTX * | getSniCtx (const std::string &serverNameIndication) |
|
| ConfigInstance (ConfigInstance &)=delete |
|
| ConfigInstance (ConfigInstance &&)=delete |
|
ConfigInstance & | operator= (ConfigInstance &)=delete |
|
ConfigInstance & | operator= (ConfigInstance &&)=delete |
|
Role | getRole () |
|
const std::string & | getInstanceName () const |
|
void | setInstanceName (const std::string &instanceName) |
|
bool | getDisabled () const |
|
void | setDisabled (bool disabled=true) |
|
ConfigTlsServer & | setForceSni (bool forceSni=true) |
|
bool | getForceSni () const |
|
ConfigTlsServer & | addSniCerts (const std::map< std::string, std::map< std::string, std::variant< std::string, bool, ssl_option_t > > > &sniCerts) |
|
ConfigTlsServer & | addSniCert (const std::string &domain, const std::map< std::string, std::variant< std::string, bool, ssl_option_t > > &sniCert) |
|
const std::map< std::string, std::map< std::string, std::variant< std::string, bool, ssl_option_t > > > & | getSniCerts () |
|
ConfigTls & | setInitTimeout (const utils::Timeval &newInitTimeout) |
|
utils::Timeval | getInitTimeout () const |
|
ConfigTls & | setShutdownTimeout (const utils::Timeval &newShutdownTimeout) |
|
utils::Timeval | getShutdownTimeout () const |
|
ConfigTls & | setCert (const std::string &cert) |
|
std::string | getCert () const |
|
ConfigTls & | setCertKey (const std::string &certKey) |
|
std::string | getCertKey () const |
|
ConfigTls & | setCertKeyPassword (const std::string &certKeyPassword) |
|
std::string | getCertKeyPassword () const |
|
ConfigTls & | setCaCert (const std::string &caCert) |
|
std::string | getCaCert () const |
|
ConfigTls & | setCaCertDir (const std::string &caCertDir) |
|
std::string | getCaCertDir () const |
|
ConfigTls & | setCaCertUseDefaultDir (bool set=true) |
|
bool | getCaCertUseDefaultDir () const |
|
ConfigTls & | setCaCertAcceptUnknown (bool set=true) |
|
bool | getCaCertAcceptUnknown () const |
|
ConfigTls & | setCipherList (const std::string &cipherList) |
|
std::string | getCipherList () const |
|
ConfigTls & | setSslOptions (ssl_option_t sslOptions) |
|
ssl_option_t | getSslOptions () const |
|
ConfigTls & | setNoCloseNotifyIsEOF (bool noCloseNotifyIsEOF=true) |
|
bool | getNoCloseNotifyIsEOF () const |
|
|
| ConfigSocketServer (const std::string &name) |
|
| ~ConfigSocketServer () override |
|
| ConfigInstance (const std::string &instanceName, Role role) |
|
virtual | ~ConfigInstance () |
|
| ConfigTlsServer (ConfigInstance *instance) |
|
| ConfigTls (ConfigInstance *instance) |
|
| ConfigSection (ConfigInstance *instance, const std::string &name, const std::string &description) |
|
| ConfigSection (const ConfigSection &)=delete |
|
| ConfigSection (ConfigSection &&)=delete |
|
ConfigSection & | operator= (const ConfigSection &)=delete |
|
ConfigSection & | operator= (ConfigSection &&)=delete |
|
CLI::Option * | addOption (const std::string &name, const std::string &description) |
|
CLI::Option * | addOption (const std::string &name, const std::string &description, const std::string &typeName) |
|
CLI::Option * | addOption (const std::string &name, const std::string &description, const std::string &typeName, const CLI::Validator &additionalValidator) |
|
template<typename ValueTypeT > |
CLI::Option * | addOption (const std::string &name, const std::string &description, const std::string &typeName, ValueTypeT defaultValue) |
|
template<typename ValueTypeT > |
CLI::Option * | addOption (const std::string &name, const std::string &description, const std::string &typeName, ValueTypeT defaultValue, const CLI::Validator &additionalValidator) |
|
CLI::Option * | addFlag (const std::string &name, const std::string &description, const std::string &typeName) |
|
CLI::Option * | addFlag (const std::string &name, const std::string &description, const std::string &typeName, const CLI::Validator &additionalValidator) |
|
template<typename ValueTypeT > |
CLI::Option * | addFlag (const std::string &name, const std::string &description, const std::string &typeName, ValueTypeT defaultValue) |
|
template<typename ValueTypeT > |
CLI::Option * | addFlag (const std::string &name, const std::string &description, const std::string &typeName, ValueTypeT defaultValue, const CLI::Validator &additionalValidator) |
|
CLI::Option * | addFlagFunction (const std::string &name, const std::function< void()> &callback, const std::string &description, const std::string &typeName, const std::string &defaultValue) |
|
CLI::Option * | addFlagFunction (const std::string &name, const std::function< void()> &callback, const std::string &description, const std::string &typeName, const std::string &defaultValue, const CLI::Validator &validator) |
|
void | required (CLI::Option *opt, bool req=true) |
|
bool | required () const |
|
template<typename ValueType > |
CLI::Option * | addOption (const std::string &name, const std::string &description, const std::string &typeName, ValueType defaultValue) |
|
template<typename ValueType > |
CLI::Option * | addOption (const std::string &name, const std::string &description, const std::string &typeName, ValueType defaultValue, const CLI::Validator &additionalValidator) |
|
template<typename ValueType > |
CLI::Option * | addFlag (const std::string &name, const std::string &description, const std::string &typeName, ValueType defaultValue) |
|
template<typename ValueType > |
CLI::Option * | addFlag (const std::string &name, const std::string &description, const std::string &typeName, ValueType defaultValue, const CLI::Validator &additionalValidator) |
|
template<typename ConfigSocketServerBaseT>
class net::config::stream::tls::ConfigSocketServer< ConfigSocketServerBaseT >
Definition at line 59 of file ConfigSocketServer.h.
template<typename ConfigSocketServerBase >
Definition at line 78 of file ConfigSocketServer.hpp.
78 {
81
83
93
95 }
96
99
100 sniCtxMap.insert(sslSans.begin(), sslSans.end());
101
102 for (
const auto& [sni, ctx] :
sniCtxMap) {
103 LOG(TRACE) <<
getInstanceName() <<
" SSL/TLS: SSL_CTX (M) sni for '" << sni <<
"' from master certificate installed";
104 }
105
106 for (
const auto& [domain, sniCertConf] :
getSniCerts()) {
107 if (!domain.empty()) {
109
111
112 for (const auto& [key, value] : sniCertConf) {
113 if (key == "Cert") {
114 sslConfig.cert = std::get<std::string>(value);
115 } else if (key == "CertKey") {
116 sslConfig.certKey = std::get<std::string>(value);
117 } else if (key == "CertKeyPassword") {
118 sslConfig.password = std::get<std::string>(value);
119 } else if (key == "CaCert") {
120 sslConfig.caCert = std::get<std::string>(value);
121 } else if (key == "CaCertDir") {
122 sslConfig.caCertDir = std::get<std::string>(value);
123 } else if (key == "CaCertUseDefaultDir") {
124 sslConfig.caCertUseDefaultDir = std::get<bool>(value);
125 } else if (key == "CaCertAcceptUnknown") {
126 sslConfig.caCertAcceptUnknown = std::get<bool>(value);
127 } else if (key == "CipherList") {
128 sslConfig.cipherList = std::get<std::string>(value);
129 } else if (key == "SslOptions") {
130 sslConfig.sslOptions = std::get<ssl_option_t>(value);
131 }
132 }
133
135
136 if (newCtx != nullptr) {
138 sniCtxMap.insert_or_assign(domain, newCtx);
139
140 LOG(TRACE) <<
getInstanceName() <<
" SSL/TLS: SSL_CTX (E) sni for '" << domain <<
"' explicitly installed";
141
144
145 LOG(TRACE) <<
getInstanceName() <<
" SSL/TLS: SSL_CTX (S) sni for '" << san <<
"' from SAN installed";
146 }
147 } else {
148 LOG(WARNING) <<
getInstanceName() <<
" SSL/TLS: Can not create SNI_SSL_CTX for domain '" << domain <<
"'";
149 }
150 }
151 }
153 for (
const auto& [sni, ctx] :
sniCtxMap) {
154 LOG(TRACE) << " " << sni;
155 }
156 }
157
159 }
const std::map< std::string, std::map< std::string, std::variant< std::string, bool, ssl_option_t > > > & getSniCerts()
std::string getCaCertDir() const
std::string getCaCert() const
std::string getCipherList() const
ssl_option_t getSslOptions() const
bool getCaCertAcceptUnknown() const
bool getCaCertUseDefaultDir() const
std::string getCertKey() const
std::string getCert() const
std::string getCertKeyPassword() const
std::map< std::string, SSL_CTX * > ssl_get_sans(SSL_CTX *sslCtx)
SSL_CTX * ssl_ctx_new(const SslConfig &sslConfig)
int socket(int domain, int type, int protocol)
References core::socket::stream::tls::SslConfig::caCert, core::socket::stream::tls::SslConfig::caCertAcceptUnknown, core::socket::stream::tls::SslConfig::caCertDir, core::socket::stream::tls::SslConfig::caCertUseDefaultDir, core::socket::stream::tls::SslConfig::cert, core::socket::stream::tls::SslConfig::certKey, core::socket::stream::tls::SslConfig::cipherList, net::config::ConfigTls::getCaCert(), net::config::ConfigTls::getCaCertAcceptUnknown(), net::config::ConfigTls::getCaCertDir(), net::config::ConfigTls::getCaCertUseDefaultDir(), net::config::ConfigTls::getCert(), net::config::ConfigTls::getCertKey(), net::config::ConfigTls::getCertKeyPassword(), net::config::ConfigTls::getCipherList(), net::config::ConfigInstance::getInstanceName(), net::config::ConfigTlsServer::getSniCerts(), net::config::ConfigTls::getSslOptions(), core::socket::stream::tls::SslConfig::instanceName, core::socket::stream::tls::SslConfig::password, net::config::stream::tls::ConfigSocketServer< ConfigSocketServerBaseT >::sniCtxMap, net::config::stream::tls::ConfigSocketServer< ConfigSocketServerBaseT >::sniCtxs, core::socket::stream::tls::ssl_ctx_new(), core::socket::stream::tls::ssl_get_sans(), core::socket::stream::tls::SslConfig::SslConfig(), net::config::stream::tls::ConfigSocketServer< ConfigSocketServerBaseT >::sslCtx, and core::socket::stream::tls::SslConfig::sslOptions.