Skip to content

[Flight] Reject port 0 in NettyClientBuilder #1271

Description

@ennuite

Port 0 is reserved and invalid for client TCP connections, but NettyClientBuilder.build() currently allows it through (it rejects only negative ports and values above 65535). The lower bound should be tightened to 1.

Four builder-based tests in the JDBC module also have a latent bug where .withPort() is never called, so the port field defaults to 0. These fail once the lower bound is tightened:

  • ConnectionTest.testGetBasicClientNoAuthShouldOpenConnection
  • ConnectionTlsTest.testGetNonAuthenticatedEncryptedClientNoAuth
  • ConnectionTlsRootCertsTest.testGetNonAuthenticatedEncryptedClientNoAuth
  • ConnectionMutualTlsTest.testGetNonAuthenticatedEncryptedClientNoAuth

Each needs .withPort(FLIGHT_SERVER_TEST_EXTENSION.getPort()) added to its builder call.

This was deferred from #1027 to keep that PR small — see #1027 (comment).

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions