MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / initCertificateHandler

Method initCertificateHandler

base/poco/NetSSL_OpenSSL/src/SSLManager.cpp:394–418  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

392
393
394void SSLManager::initCertificateHandler(bool server)
395{
396 if (server && _ptrServerCertificateHandler) return;
397 if (!server && _ptrClientCertificateHandler) return;
398
399 std::string prefix = server ? CFG_SERVER_PREFIX : CFG_CLIENT_PREFIX;
400 Poco::Util::AbstractConfiguration& config = appConfig();
401
402 std::string className(config.getString(prefix+CFG_CERTIFICATE_HANDLER, VAL_CERTIFICATE_HANDLER));
403
404 const CertificateHandlerFactory* pFactory = 0;
405 if (certificateHandlerFactoryMgr().hasFactory(className))
406 {
407 pFactory = certificateHandlerFactoryMgr().getFactory(className);
408 }
409
410 if (pFactory)
411 {
412 if (server)
413 _ptrServerCertificateHandler = pFactory->create(true);
414 else
415 _ptrClientCertificateHandler = pFactory->create(false);
416 }
417 else throw Poco::Util::UnknownOptionException(std::string("No InvalidCertificate handler known with the name ") + className);
418}
419
420
421Context::Ptr SSLManager::getCustomServerContext(const std::string & name)

Callers

nothing calls this directly

Calls 4

getStringMethod · 0.45
hasFactoryMethod · 0.45
getFactoryMethod · 0.45
createMethod · 0.45

Tested by

no test coverage detected