Skip to content

Add TLS and mTLS support#165

Open
HTHou wants to merge 1 commit into
mainfrom
codex/add-tls-mtls-support
Open

Add TLS and mTLS support#165
HTHou wants to merge 1 commit into
mainfrom
codex/add-tls-mtls-support

Conversation

@HTHou

@HTHou HTHou commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Add TLS and mTLS support for the Go client session transport path.

Changes

  • Add client.TLSConfig with CA trust loading and optional client certificate/key loading.
  • Use TLS transport when TLSConfig is present for standalone sessions, cluster sessions, reconnects, and session pools.
  • Document TLS/mTLS usage in English and Chinese READMEs.
  • Add unit coverage for TLS config cloning, CA/client certificate loading, and client cert/key validation.

Validation

  • git diff --cached --check
  • go test $(go list ./... | grep -v '/test/e2e')\n\nE2E tests were not run locally because they require an IoTDB service/DNS entry (iotdb) in the test environment.

@HTHou HTHou marked this pull request as ready for review June 26, 2026 09:14
@HTHou HTHou requested a review from Copilot June 26, 2026 09:17
@HTHou HTHou linked an issue Jun 26, 2026 that may be closed by this pull request

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds TLS and mutual TLS (mTLS) support to the Go client’s Thrift transport creation path, allowing sessions, cluster sessions, and session pools to connect securely using configured CA trust and optional client certificates.

Changes:

  • Introduces client.TLSConfig plus helpers to build a *tls.Config from CA/client cert/key files.
  • Routes session and cluster session transport creation through a shared newTransport(..., tlsConfig) that can create either plain or TLS transports.
  • Documents TLS/mTLS usage in English and Chinese READMEs and adds unit tests for TLS config behavior.

Reviewed changes

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

Show a summary per file
File Description
README.md Documents TLS/mTLS configuration and provides a usage snippet.
README_ZH.md Adds the same TLS/mTLS guidance in Chinese.
client/tls.go Implements TLSConfig, TLS config building, and TLS-capable transport creation.
client/tls_test.go Adds unit tests for cloning base TLS config, loading CA/cert/key files, and cert/key validation.
client/sessionpool.go Plumbs TLSConfig through pool config into session/cluster configs.
client/session.go Switches session and cluster session transport initialization to use the TLS-capable transport helper.

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

Comment thread client/tls.go
Comment thread client/session.go
@HTHou HTHou force-pushed the codex/add-tls-mtls-support branch from f105c26 to df6df55 Compare June 26, 2026 09:27
@HTHou HTHou requested a review from Copilot June 26, 2026 09:28

Copilot AI left a comment

Copy link
Copy Markdown

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 6 out of 6 changed files in this pull request and generated no new comments.

@HTHou HTHou requested a review from shuwenwei June 26, 2026 10:14
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.

iotdb go client not support tls?

2 participants