Skip to content

Rust SDK: Add dedicated TCP/TLS examples #2810

@mmodzelewski

Description

@mmodzelewski

Summary

The Rust SDK has comprehensive TCP/TLS support (using `rustls`/`tokio-rustls`) and integration tests exist at the server level (`core/integration/tests/server/scenarios/tcp_tls_scenario.rs`), but there are no dedicated TLS examples in `examples/rust/`.

Current State

  • TLS implementation: Full support in `core/sdk/src/tcp/`:
    • `tcp_tls_connection_stream.rs` - TLS connection stream
    • `tcp_tls_verifier.rs` - Custom TLS certificate verifier
    • `tcp_client.rs` - Client with TLS support
    • Also WebSocket TLS and QUIC TLS support
  • Integration tests: Server-level TLS scenario exists in `core/integration/tests/server/scenarios/tcp_tls_scenario.rs` that tests stream/topic creation, message send/receive over TLS
  • Examples: CLI args in `examples/rust/src/shared/args.rs` support `--tcp-tls-enabled`, `--tcp-tls-domain`, `--tcp-tls-ca-file` flags, but there is no dedicated TLS example showing how to use them. Users need to discover these flags themselves.

Requirements

Examples

  • Add a dedicated TLS example in `examples/rust/` demonstrating:
    • How to configure `IggyClientBuilder` with TLS options (enabled, domain, CA file)
    • How to use custom certificates from `core/certs/` (`iggy_ca_cert.pem`, `iggy_cert.pem`, `iggy_key.pem`)
    • A simple producer/consumer flow over TLS
    • Include instructions in comments/README for how to start the server with TLS enabled
  • Alternatively or additionally, document the TLS CLI flags usage with an example command in the existing examples

Reference

  • TLS implementation: `core/sdk/src/tcp/tcp_tls_connection_stream.rs`
  • Existing TLS scenario test: `core/integration/tests/server/scenarios/tcp_tls_scenario.rs`
  • CLI args with TLS flags: `examples/rust/src/shared/args.rs`
  • 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/`

Metadata

Metadata

Assignees

Labels

good first issueGood for newcomersrustPull requests that update Rust codesdkChange related to sdk (client) APItestNew testcase, or improvement of existing

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions