8000 add support for SNI override by joe-clickhouse · Pull Request #127 · ClickHouse/mcp-clickhouse · GitHub
[go: up one dir, main page]

Skip to content

add support for SNI override - #127

Merged
joe-clickhouse merged 3 commits into
mainfrom
joe/126-support-sni-override-and-custom-proxy-paths-for-clickhouse-connections
Apr 14, 2026
Merged

joe-clickhouse merged 3 commits into
mainfrom
joe/126-support-sni-override-and-custom-proxy-paths-for-clickhouse-connections

Conversation

@joe-clickhouse
Copy link
Copy Markdown
Collaborator

Summary

Adds support for CLICKHOUSE_SERVER_HOST_NAME environment variable to enable SNI (Server Name Indication) override during TLS connections.

Usage

export CLICKHOUSE_HOST=load-balancer.example.com
export CLICKHOUSE_SERVER_HOST_NAME=server.example.com

Closes #126

Copilot AI left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a configurable SNI/certificate-validation hostname override for ClickHouse TLS connections (via CLICKHOUSE_SERVER_HOST_NAME) to support connecting through load balancers/proxies where the connection endpoint hostname differs from the certificate hostname.

Changes:

  • Introduces CLICKHOUSE_SERVER_HOST_NAME to override TLS SNI / hostname validation by passing server_host_name into clickhouse_connect.get_client.
  • Updates connection logging to include server_host_name when configured.
  • Documents the new environment variable in the README.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
mcp_clickhouse/mcp_server.py Logs server_host_name when present to make TLS/SNI overrides visible in runtime diagnostics.
mcp_clickhouse/mcp_env.py Adds CLICKHOUSE_SERVER_HOST_NAME env var support and includes it in the ClickHouse client config dict.
README.md Documents CLICKHOUSE_SERVER_HOST_NAME usage and behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread mcp_clickhouse/mcp_env.py Resolved
Comment thread mcp_clickhouse/mcp_env.py Resolved
Comment thread mcp_clickhouse/mcp_server.py Resolved
Copilot AI left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@joe-clickhouse
joe-clickhouse merged commit d35c521 into main Apr 14, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for SNI override in ClickHouse connections

3 participants

0