Fix SSL connection creation by HTHou · Pull Request #13 · apache/iotdb-client-nodejs · GitHub
Skip to content

Fix SSL connection creation#13

Merged
CritasWang merged 1 commit into
developfrom
codex/fix-nodejs-ssl-connection
Jun 26, 2026
Merged

Fix SSL connection creation#13
CritasWang merged 1 commit into
developfrom
codex/fix-nodejs-ssl-connection

Conversation

@HTHou

@HTHou HTHou commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Summary

This fixes the SSL connection path so enableSSL: true creates a TLS socket with thrift.createSSLConnection(...) instead of a plain Thrift TCP connection.

Root Cause

The previous enableSSL branch still called thrift.createConnection(...). For IoTDB's raw Thrift RPC port, that sends plaintext bytes to an SSL-enabled server, so a server configured with enable_thrift_ssl=true rejects the connection before the session can open.

Changes

  • Use thrift.createSSLConnection(...) when enableSSL is true.
  • Keep the non-SSL path on thrift.createConnection(...).
  • Add unit tests to verify the SSL and non-SSL connection factories selected by Connection.open().

Validation

  • npm test -- --runInBand tests/unit/Connection.test.ts
  • npm run test:unit
  • npm run build

npm run lint currently fails on existing repository-wide lint issues in benchmark/examples/e2e and pre-existing source files; this PR does not add new lint failures in the changed unit test.

@HTHou HTHou marked this pull request as ready for review June 26, 2026 08:20
@CritasWang CritasWang merged commit 1b9c662 into develop Jun 26, 2026
2 checks passed
@CritasWang CritasWang deleted the codex/fix-nodejs-ssl-connection branch June 26, 2026 08:49
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.

2 participants