Skip to content

[FIXED in 4.6.0] Cloudflare: ssl: 'prefer' times out when the server declines TLS #153

Closed

Description

@okomarov

On Cloudflare Workers, ssl: 'prefer' against a server that answers N to the SSLRequest ends in CONNECT_TIMEOUT instead of continuing without TLS.

The polyfill reads only the one-byte SSL reply (readFirst() in cf/polyfills.js) and never starts its read loop when the reply is not S, so the startup exchange that follows is never read.

Reproduced in real workerd at every compatibility date by the ssl-prefer-declined scenario: run 39149730488 (PR #150). src/ over workerd's node:net passes.

Fix on PR #151: readFirst() starts the read loop unless the reply is S, where the TLS upgrade starts its own.

Activity

  1. added
    bug
    area: runtimes
    on Oct 18, 2026
  2. moved this to In progress in Roadmapon Oct 18, 2026
  3. okomarov commented on Oct 19, 2026

    @okomarov
    Author

    Fixed on main by 2cf42d9 (#151); ships in the next release.

  4. added this to the 4.6.0 milestone on Oct 20, 2026
  5. moved this from In progress to Shipped in Roadmapon Oct 21, 2026
  6. okomarov commented on Oct 21, 2026

    @okomarov
    Author

    Shipped in 4.6.0 (npm install @steadybrew/[email protected]), unchanged from 4.6.0-rc1. The tests that cover it passed in the tag run.

  7. changed the title [-]Cloudflare: ssl: 'prefer' times out when the server declines TLS[/-] [+][FIXED in 4.6.0] Cloudflare: ssl: 'prefer' times out when the server declines TLS[/+] on Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: runtimesbug

    Type

    No type

    Projects

    • Status
      Shipped

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions