From ce668e44919458e66f1e18a18be1a58b478b5582 Mon Sep 17 00:00:00 2001 From: Pradeep Chhetri Date: Sun, 12 Nov 2023 14:45:17 +0800 Subject: [PATCH] Enable --secure flag for clickhouse-client for hostnames pointing to clickhouse cloud --- src/Client/ConnectionParameters.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Client/ConnectionParameters.cpp b/src/Client/ConnectionParameters.cpp index 3942527e5b5..34893dd6e0c 100644 --- a/src/Client/ConnectionParameters.cpp +++ b/src/Client/ConnectionParameters.cpp @@ -30,7 +30,8 @@ ConnectionParameters::ConnectionParameters(const Poco::Util::AbstractConfigurati , port(connection_port.value_or(getPortFromConfig(config))) { bool is_secure = config.getBool("secure", false); - security = is_secure ? Protocol::Secure::Enable : Protocol::Secure::Disable; + bool is_clickhouse_cloud = connection_host.ends_with(".clickhouse.cloud"); + security = (is_secure || is_clickhouse_cloud) ? Protocol::Secure::Enable : Protocol::Secure::Disable; default_database = config.getString("database", "");