Skip to content

add support for SNI override#127

Open
joe-clickhouse wants to merge 3 commits intomainfrom
joe/126-support-sni-override-and-custom-proxy-paths-for-clickhouse-connections
Open

add support for SNI override#127
joe-clickhouse wants to merge 3 commits intomainfrom
joe/126-support-sni-override-and-custom-proxy-paths-for-clickhouse-connections

Conversation

@joe-clickhouse
Copy link
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

Copy link
Contributor

Copilot AI left a comment

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.

Copy link
Contributor

Copilot AI left a comment

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.

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

2 participants