Skip to content

Upgrade wasmtime-wasi-tls implementation to phase 2 #12102

@Aditya1404Sal

Description

@Aditya1404Sal

Feature

Implement WASI TLS Phase 2 following the simplified security-focused wit proposal from WebAssembly/wasi-tls#13

Benefit

Phase 1 is unstable and only supports client-side TLS. This blocks WASI components from:

  • Accepting incoming TLS connections (servers, proxies)
  • Accessing connection metadata (cipher suite, peer certificates)
  • Following modern async patterns aligned with Preview 2/3

Phase 2 adds server-side support with a simplified, security-first API that:

  • Focuses on TLS 1.3 (modern security, 75%+ adoption)
  • Removes problematic features (0-RTT replay attacks, suspension points)
  • Uses linear async flow that naturally evolves to Preview 3's async/await
  • Reduces API surface by ~40% while adding critical functionality

Implementation

Replace current Phase 1 WIT with Phase 2 proposal from WebAssembly/wasi-tls#13

Key additions:

  • Server resource with identity/ALPN/client-auth configuration
  • Connection resource with cipher-suite, peer-certificate, close methods
  • accept() for server-side handshakes
  • Async pattern: finish() + subscribe() (Preview 2) -> async finish() (Preview 3)
  • Unified rustls/native-tls provider architecture with client/server separation

Security benefits:

  • No suspension points = no deadlock/state machine complexity
  • TLS 1.3 focus = modern ciphers, forward secrecy
  • Linear flow = easier auditing, fewer vulnerabilities

Alternatives

Nonexistent

Metadata

Metadata

Assignees

No one assigned

    Labels

    wasi:implIssues pertaining to WASI implementation in Wasmtime

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions