Net: add TLS client stream and SMTP submission #48

Closed
opened 2026-12-03 10:24:27 +00:00 by faumaray · 1 comment
Owner

Context: Forge needs TLS client streams and SMTP submission over TLS for verification/recovery email. Forge tracks this as VL-NET-02; production registration stays disabled until it lands.

Current behavior: HttpClient has secure()/insecure defaults, but there is no reusable TLS stream API and no SMTP client.

Need:

  • a TLS client stream that wraps a socket, verifies peer and hostname against the intended trust store, supports cancellation and deadlines, and never falls back to insecure on failure;
  • SMTP submission over TLS (STARTTLS or implicit) with authentication and bounded message sizes.

Tests/gate: hostname/trust-store failures, redirect/credential handling, cancellation, partial writes, SMTP dialogue fixtures and oversized messages. Forge M04/M18 consume it.

Context: Forge needs TLS client streams and SMTP submission over TLS for verification/recovery email. Forge tracks this as VL-NET-02; production registration stays disabled until it lands. Current behavior: HttpClient has secure()/insecure defaults, but there is no reusable TLS stream API and no SMTP client. Need: - a TLS client stream that wraps a socket, verifies peer and hostname against the intended trust store, supports cancellation and deadlines, and never falls back to insecure on failure; - SMTP submission over TLS (STARTTLS or implicit) with authentication and bounded message sizes. Tests/gate: hostname/trust-store failures, redirect/credential handling, cancellation, partial writes, SMTP dialogue fixtures and oversized messages. Forge M04/M18 consume it.
Author
Owner

Implemented on branch issue-48-tls-smtp (commit 44686a4): verified-only TlsClientStream (no insecure fallback, SNI/hostname + trust store verification, STARTTLS via connect_plain/start_tls, deadlines, stop tokens, partial-write handling) and SMTP submission over TLS with authentication and bounded message sizes. Merged into main as d51dd17; the Net Testing;Net -Werror suite passes (564 tests, 561 passed, 3 skipped) after fixing a module-dependency parser bug exposed by comments in module.cmake (7b3258a). Pushed to origin/main. Closing as done.

Implemented on branch `issue-48-tls-smtp` (commit `44686a4`): verified-only `TlsClientStream` (no insecure fallback, SNI/hostname + trust store verification, STARTTLS via `connect_plain`/`start_tls`, deadlines, stop tokens, partial-write handling) and SMTP submission over TLS with authentication and bounded message sizes. Merged into `main` as `d51dd17`; the Net `Testing;Net` `-Werror` suite passes (564 tests, 561 passed, 3 skipped) after fixing a module-dependency parser bug exposed by comments in `module.cmake` (`7b3258a`). Pushed to origin/main. Closing as done.
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Void/Library#48