Skip to content

Java SDK: Add TCP/TLS integration tests and examples #2805

@mmodzelewski

Description

@mmodzelewski

Summary

The Java SDK has TCP/TLS support implemented (both blocking via IggyTcpClientBuilder.enableTls() and async via Netty's SslContextBuilder), but there are no dedicated integration tests that actually connect to a TLS-enabled server, and no TLS examples in examples/java/.

Current State

  • TLS implementation: Present in both blocking (IggyTcpClient) and async (AsyncTcpConnection) clients
  • Existing tests: AsyncIggyTcpClientBuilderTest has unit-level tests for TLS builder methods (testBuildClientWithTlsBoolean, testBuildClientWithEnableTls, testHandleNullTlsCertificateString), but none actually connect to a TLS-enabled server
  • Examples: No TLS-specific examples exist in examples/java/

Requirements

Integration Tests

  • Add integration test(s) that start an Iggy server with TLS enabled and connect using the Java TCP client with TLS
  • Test both blocking and async TLS connections
  • Use custom certificates from core/certs/ (iggy_ca_cert.pem, iggy_cert.pem, iggy_key.pem)
  • Test scenarios:
    • Successful TLS connection with custom CA certificate
    • Successful TLS connection with server certificate
    • Connection failure when TLS is required but client doesn't use TLS
    • Basic message send/receive over TLS connection
  • Reference the C# TLS integration tests (foreign/csharp/Iggy_SDK.Tests.Integration/IggyTlsConnectionTests.cs) as an example of the approach

Examples

  • Add a TLS example in examples/java/ demonstrating:
    • How to configure the client builder with TLS enabled
    • How to specify a custom CA certificate file
    • A simple producer/consumer flow over TLS

Reference

  • Server TLS config env vars: IGGY_TCP_TLS_ENABLED=true, IGGY_TCP_TLS_CERT_FILE, IGGY_TCP_TLS_KEY_FILE
  • Custom certs location: core/certs/
  • C# TLS tests for reference: foreign/csharp/Iggy_SDK.Tests.Integration/IggyTlsConnectionTests.cs

Metadata

Metadata

Assignees

Labels

good first issueGood for newcomersjavaIssues related to Java SDKsdkChange related to sdk (client) APItestNew testcase, or improvement of existing

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions