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

Method makeSecureConnectionSSL

src/Server/PostgreSQLHandler.cpp:347–371  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

345
346#if USE_SSL
347void PostgreSQLHandler::makeSecureConnectionSSL()
348{
349 message_transport->send('S', true);
350 Poco::Net::Context::Ptr ctx;
351 if (!params.privateKeyFile.empty() && !params.certificateFile.empty())
352 {
353 ctx = Poco::Net::SSLManager::instance().getCustomServerContext(prefix);
354 if (!ctx)
355 {
356 ctx = new Poco::Net::Context(usage, params);
357 ctx->disableProtocols(disabled_protocols);
358 ctx->enableExtendedCertificateVerification(extended_verification);
359 if (prefer_server_ciphers)
360 ctx->preferServerCiphers();
361 CertificateReloader::instance().tryLoad(config, ctx->sslContext(), prefix);
362 ctx = Poco::Net::SSLManager::instance().setCustomServerContext(prefix, ctx);
363 }
364 }
365 else
366 {
367 ctx = Poco::Net::SSLManager::instance().defaultServerContext();
368 }
369 ss = std::make_shared<Poco::Net::SecureStreamSocket>(Poco::Net::SecureStreamSocket::attach(socket(), ctx));
370 changeIO(*ss);
371}
372#else
373void PostgreSQLHandler::makeSecureConnectionSSL() {}
374#endif

Callers

nothing calls this directly

Calls 11

attachFunction · 0.85
disableProtocolsMethod · 0.80
preferServerCiphersMethod · 0.80
sslContextMethod · 0.80
defaultServerContextMethod · 0.80
sendMethod · 0.45
emptyMethod · 0.45
tryLoadMethod · 0.45

Tested by

no test coverage detected