Skip to content

v0.3.3 — TLS handshake fix (wss://)

Choose a tag to compare

@sepehr-safari sepehr-safari released this 11 Jul 22:22
996e8a2

Fixed

Follow-up to v0.3.2. That release fixed the readSliceShort fill-deadlock by reading once with readVec, but a readVec of zero bytes means "no application data yet", not end-of-stream — a TLS record can carry none. IoStream.read reported that zero as EOF, so the websocket handshake against a real wss:// relay aborted with HandshakeFailed (plaintext ws:// was unaffected).

read now retries past a bare zero read and returns only on the first real bytes or a genuine end of stream. Verified live: ws:// (local relay) completes a full NIP-46 request round-trip, and wss:// (relay.damus.io) now completes the TLS handshake. Adds a regression test for the zero-then-data case. (#46)

Full changelog: https://github.com/zig-nostr/nostr/blob/main/CHANGELOG.md