Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clickhouse: control whether to verify SSL certificate #4631

Merged
merged 1 commit into from
Feb 9, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion redash/query_runner/clickhouse.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,15 @@ def configuration_schema(cls):
"title": "Request Timeout",
"default": 30,
},
"verify": {
"type": "boolean",
"title": "Verify SSL certificate",
"default": True,
},
},
"order": ["url", "user", "password", "dbname"],
"required": ["dbname"],
"extra_options": ["timeout"],
"extra_options": ["timeout", "verify"],
"secret": ["password"],
}

Expand Down Expand Up @@ -59,6 +65,7 @@ def _get_tables(self, schema):
def _send_query(self, data, stream=False):
url = self.configuration.get("url", "http://127.0.0.1:8123")
try:
verify = self.configuration.get("verify", True)
r = requests.post(
url,
data=data.encode("utf-8"),
Expand All @@ -69,6 +76,7 @@ def _send_query(self, data, stream=False):
"password": self.configuration.get("password", ""),
"database": self.configuration["dbname"],
},
verify=verify,
)
if r.status_code != 200:
raise Exception(r.text)
Expand Down