Skip to content

TLS handshake error #58854

Closed as not planned
Closed as not planned

Description

@whoareyou1122

Description

i am constantly getting an error on opencode whether its through my OpenAI key or through an opencode go subscription or a free model i get this constant error every 1-5 minutes

ive deleted, redownloaded both CLI and desktop app, signed in and out of my openai and opencode go, changed my DNS to cloudfare and googles, did a bunch of opencode terminal commands, and even asked my gpt 6 to diagnos and fix the issue yet to no help.

Image

Plugins

none

OpenCode version

desktop 2.1.4

Steps to reproduce

  1. write prompt
  2. wait a minute
  3. TLS handshake error

Screenshot

Image

Operating System

Windows 11

Terminal

windows terminal and opencode desktop app

Activity

  1. opencode-agent commented on Oct 25, 2026

    @opencode-agent
    Contributor

    Thanks for the report, and for listing everything you've already tried. Because this happens with every provider and in both the CLI and the desktop app, it's most likely caused by something between your machine and the internet. To narrow it down, could you share:

    1. The exact error text. Please paste it as text; the screenshot is hard to read.
    2. Network and security software: are you behind a proxy, VPN or corporate network? Do you run antivirus or firewall software that scans HTTPS/SSL traffic (e.g. Kaspersky, Avast/AVG, ESET, Bitdefender, Norton)? If so, does the error stop when that scanning is turned off?
    3. Another network: does it still happen on a different network, e.g. your phone's hotspot?
    4. Logs: run the CLI with opencode --print-logs --log-level DEBUG, wait until the error appears, and paste the lines around it (remove any API keys).
    5. Which opencode --version the CLI reports, if it isn't also 2.1.4.

    You can reply here with the details, or edit the issue. If you edit it, please also leave a comment saying you've updated it so we know when you're done.

    These issues are related, ordered from most to least likely relevant:

  2. fully-autonomous commented on Oct 25, 2026

    @fully-autonomous

    I am also getting this consistently .

  3. Etherite1 commented on Oct 26, 2026

    @Etherite1

    also getting this a lot, using GPT 6.1 sol via openai.

  4. opencodejr commented on Oct 28, 2026

    @opencodejr
    Contributor

    Thanks for the report, and for listing everything you've already tried.

    The error happens with every provider (OpenAI, OpenCode Go and free models), in both the CLI and the desktop app. That usually points to something on the network between your machine and the provider. To narrow it down, could you share:

    1. The full error text, copied as text, not a screenshot. Include any details shown under it, such as the URL, an error code like ECONNRESET or UNABLE_TO_VERIFY_LEAF_SIGNATURE, or the host name.
    2. Logs from a failing run. Start the CLI with opencode --print-logs, wait until the error appears, then paste the relevant lines here (please remove any API keys).
    3. Your network setup:
      • Are you using a VPN, proxy, or corporate/school network?
      • Does your antivirus or firewall do HTTPS/SSL scanning? Avast, AVG, Kaspersky, ESET and Bitdefender often do.
      • Are any HTTP_PROXY, HTTPS_PROXY or NODE_EXTRA_CA_CERTS environment variables set?
    4. What happens to the session: does the request fail and stop, or does OpenCode retry and carry on? Does it happen on another network, for example a phone hotspot?

    You can reply here with the details or edit the issue. If you edit it, please also leave a comment saying you've updated it, so we know you're done.

  5. opencodejr commented on Oct 31, 2026

    @opencodejr
    Contributor

    We're closing this for now because we haven't heard back. We needed the full error text, logs from opencode --print-logs, and details of your network setup (VPN, proxy, or antivirus HTTPS scanning) to look into the TLS handshake errors on 2.1.4. Without them we can't tell whether OpenCode or something on the network is causing it.

    If it still happens, reply here with those details and we can reopen it, or open a new issue that links to this one. Thanks for the report.

  6. ZurgInq commented on Nov 7, 2026

    @ZurgInq

    OS: Windows 10
    VPN: Hiddify VPN in TUN Mode
    Version: Opencode 2.2.6

    Error message from opencode.log

    timestamp=2026-11-07T14:44:14.988Z level=ERROR run=ca41a217 message="Failed to drain Session" cause="AI.Error: EPROTO: The TLS handshake failed. Does the server speak TLS on this port?\n    at a (B:/~BUN/root/chunk-cqy77ns1.js:3:3594)\n    at <anonymous> (B:/~BUN/root/chunk-p16d9s94.js:11:1512)\n    at map (native:1:11)\n    at <anonymous> (B:/~BUN/root/chunk-p16d9s94.js:11:1476)\n    at <anonymous> (B:/~BUN/root/chunk-p16d9s94.js:24:15946)\n    at runLoop (B:/~BUN/root/chunk-p16d9s94.js:24:2586)\n    at evaluate (B:/~BUN/root/chunk-p16d9s94.js:24:1718)\n    at runInAsyncScope (node:async_hooks:207:23)\n    at evaluate (B:/~BUN/root/chunk-p16d9s94.js:24:1575)\n    at <anonymous> (B:/~BUN/root/chunk-p16d9s94.js:24:6898)\n    at POST\n    at SessionStep.attempt (B:/~BUN/root/chunk-1abfnrtc.js:482:4059)\n    at SessionStep.attempt (definition) (B:/~BUN/root/chunk-1abfnrtc.js:467:302)\n    at SessionRunner.runStep (B:/~BUN/root/chunk-1abfnrtc.js:482:2974)\n    at SessionRunner.runStep (definition) (B:/~BUN/root/chunk-1abfnrtc.js:482:3159)\n    at SessionRunner.drain (B:/~BUN/root/chunk-1abfnrtc.js:482:6693)\n    at SessionRunner.drain (definition) (B:/~BUN/root/chunk-1abfnrtc.js:482:538)\n    at ServerProcess.start (B:/~BUN/root/chunk-vjacg5s7.js:3:6180)\n    at ServerProcess.start (definition) (B:/~BUN/root/chunk-1abfnrtc.js:584:35594) {\n  [cause]: AI.Error.Transport: EPROTO: The TLS handshake failed. Does the server speak TLS on this port?\n      at a (B:/~BUN/root/chunk-cqy77ns1.js:3:3609)\n      at <anonymous> (B:/~BUN/root/chunk-p16d9s94.js:11:1512)\n      at map (native:1:11)\n      at <anonymous> (B:/~BUN/root/chunk-p16d9s94.js:11:1476)\n      at <anonymous> (B:/~BUN/root/chunk-p16d9s94.js:24:15946)\n      at runLoop (B:/~BUN/root/chunk-p16d9s94.js:24:2586)\n      at evaluate (B:/~BUN/root/chunk-p16d9s94.js:24:1718)\n      at runInAsyncScope (node:async_hooks:207:23)\n      at evaluate (B:/~BUN/root/chunk-p16d9s94.js:24:1575)\n      at <anonymous> (B:/~BUN/root/chunk-p16d9s94.js:24:6898) {\n    [cause]: TypeError: EPROTO: The TLS handshake failed. Does the server speak TLS on this port?\n  }\n}" role=server sessionID=ses_e4998dd22ffePT5RvQx0f56Exa
    
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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions