Skip to content

thv llm setup --tls-skip-verify: NODE_TLS_REJECT_UNAUTHORIZED=0 is overly broad for Claude Code #5129

@yrobla

Description

@yrobla

Problem

When thv llm setup --tls-skip-verify is used for Claude Code, the setup writes:

{ "env": { "NODE_TLS_REJECT_UNAUTHORIZED": "0" } }

to ~/.claude/settings.json. This disables TLS certificate verification for the entire Claude Code Node.js process, not just connections to the LLM gateway. Claude Code also connects to api.anthropic.com, the MCP registry, and other endpoints — all of these lose certificate verification while this setting is in place.

NODE_TLS_REJECT_UNAUTHORIZED=0 is the only widely-supported way to skip TLS for a Node.js process targeting a specific host, so a fully targeted solution (per-host override) isn't straightforward. However, the risk should be documented and the UX should make the scope of the setting explicit.

Proposed mitigations

  1. Stronger warning — When writing NODE_TLS_REJECT_UNAUTHORIZED=0, print a clearly scoped warning: "This disables TLS verification for all of Claude Code's outbound connections, not just the LLM gateway. Use only in isolated local environments."
  2. Document in help text — The --tls-skip-verify flag description on setup should note this scope.
  3. (Future / ideal) — Investigate whether a per-origin TLS override is feasible via a custom apiKeyHelper wrapper or proxy-side passthrough to avoid setting the global flag at all.

Acceptance Criteria

  • thv llm setup --tls-skip-verify prints a visible warning explaining the overly broad scope of NODE_TLS_REJECT_UNAUTHORIZED=0
  • The --tls-skip-verify flag description on thv llm setup mentions that it affects all Claude Code TLS connections
  • A follow-up investigation task is tracked for a more targeted solution

References

  • pkg/llm/setup.gosetupClaudeCodeAt (sets NODE_TLS_REJECT_UNAUTHORIZED)
  • cmd/thv/app/llm.gonewLLMSetupCmd flag description

Metadata

Metadata

Assignees

No one assigned

    Labels

    cliChanges that impact CLI functionalityenhancementNew feature or requestgoPull requests that update go codesecurity

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions