| 392 | |
| 393 | |
| 394 | void 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 | |
| 421 | Context::Ptr SSLManager::getCustomServerContext(const std::string & name) |
nothing calls this directly
no test coverage detected