Skip to content

fix(policy): restore L4 tunnel for WebSocket hosts via tls: skip - #2098

Merged
ericksoa merged 1 commit into
mainfrom
fix/2092-websocket-tls-skip
Apr 20, 2026
Merged

fix(policy): restore L4 tunnel for WebSocket hosts via tls: skip#2098
ericksoa merged 1 commit into
mainfrom
fix/2092-websocket-tls-skip

Conversation

@laitingsheng

@laitingsheng laitingsheng commented Apr 20, 2026

Copy link
Copy Markdown
Contributor

OpenShell v0.0.15+ auto-terminates TLS unconditionally on every detected TLS stream, which also applies to WSS. Without an explicit opt-out, messaging WebSocket endpoints (previously shipping as pure L4 CONNECT tunnels via access: full) are now MITMed, and the Discord client consistently loses its gateway connection with close code 1006.

Add tls: skip to the affected endpoints to restore the pre-v0.0.15 pass-through behaviour:

  • discord preset: gateway.discord.gg
  • slack preset: wss-primary.slack.com, wss-backup.slack.com
  • baseline openclaw-sandbox.yaml: gateway.discord.gg

Extend the policy schemas to accept skip in the tls enum.

Fixes #2092.
Fixes #1738.

Related to #2085.

Summary

Related Issue

Changes

Type of Change

  • Code change (feature, bug fix, or refactor)
  • Code change with doc updates
  • Doc only (prose changes, no code sample modifications)
  • Doc only (includes code sample changes)

Verification

  • npx prek run --all-files passes
  • npm test passes
  • Tests added or updated for new or changed behavior
  • No secrets, API keys, or credentials committed
  • Docs updated for user-facing behavior changes
  • make docs builds without warnings (doc changes only)
  • Doc pages follow the style guide (doc changes only)
  • New doc pages include SPDX header and frontmatter (new pages only)

AI Disclosure

  • AI-assisted — tool: Claude Code

Signed-off-by: Tinson Lai tinsonl@nvidia.com

Summary by CodeRabbit

  • Bug Fixes
    • Improved TLS handling for Discord and Slack WebSocket connections to prevent timeout issues and restore proper pass-through behavior for long-lived secure connections.

OpenShell [v0.0.15+ auto-terminates TLS unconditionally](NVIDIA/OpenShell#544)
on every detected TLS stream, which also applies to WSS. Without an
explicit opt-out, messaging WebSocket endpoints (previously shipping
as pure L4 CONNECT tunnels via `access: full`) are now MITMed, and
the Discord client consistently loses its gateway connection with
close code 1006.

Add `tls: skip` to the affected endpoints to restore the pre-v0.0.15
pass-through behaviour:
  - discord preset: gateway.discord.gg
  - slack preset:   wss-primary.slack.com, wss-backup.slack.com
  - baseline openclaw-sandbox.yaml: gateway.discord.gg

Extend the policy schemas to accept `skip` in the `tls` enum.

Fixes #2092.
Fixes #1738.

Related to #2085.

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Tinson Lai <tinsonl@nvidia.com>
@coderabbitai

coderabbitai Bot commented Apr 20, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

The changes introduce a new tls: skip configuration option for network endpoints in policy definitions and update corresponding JSON schemas to permit this value. The addition targets Discord and Slack WebSocket endpoints to enable TLS passthrough behavior for long-lived connections.

Changes

Cohort / File(s) Summary
Discord and Slack Policies
nemoclaw-blueprint/policies/openclaw-sandbox.yaml, nemoclaw-blueprint/policies/presets/discord.yaml, nemoclaw-blueprint/policies/presets/slack.yaml
Added tls: skip field to gateway WebSocket endpoint definitions for Discord (gateway.discord.gg:443) and Slack (wss-primary.slack.com, wss-backup.slack.com). Updated comments to clarify that tls: skip enables pre-v0.0.15 TLS passthrough behavior for WSS connections, replacing prior guidance on CONNECT tunnels and idle timeout avoidance.
Schema Definitions
schemas/blueprint.schema.json, schemas/policy-preset.schema.json, schemas/sandbox-policy.schema.json
Extended the tls property enum for endpoint objects from ["terminate", "passthrough"] to ["terminate", "passthrough", "skip"], enabling schema validation of the new TLS skip mode across all policy types.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 A tunnel pure, at L4 we stay,
Where TLS dances, then skips away,
Discord's gateway now whispers through,
WebSocket wounds fade to skies of blue!
Skip ahead, friend—no more 1006 woes! 🎉

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: adding tls: skip to WebSocket endpoints to restore L4 tunnel behavior for Discord/Slack hosts.
Linked Issues check ✅ Passed The PR fully addresses both linked issues [#2092, #1738]: adds tls: skip to Discord gateway and Slack WebSocket endpoints, extends schemas to support the new enum value, and resolves the 1006 WebSocket close failures.
Out of Scope Changes check ✅ Passed All changes are scoped to the stated objectives: policy endpoint updates and schema extensions for tls: skip; no unrelated refactoring, dependencies, or features introduced.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/2092-websocket-tls-skip

Comment @coderabbitai help to get the list of available commands and usage tips.

@ericksoa ericksoa left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Straightforward fix — adds tls: skip to the WebSocket endpoints that need pure L4 pass-through now that OpenShell v0.0.15+ auto-terminates TLS.

  • Correct endpoints targeted (Discord gateway, Slack Socket Mode primary + backup)
  • Schemas updated consistently across all three files
  • Comments accurately explain the change motivation (NVIDIA/OpenShell#544)
  • Discord preset stays in sync with baseline openclaw-sandbox.yaml
  • CI all green

@ericksoa
ericksoa merged commit 27c18b0 into main Apr 20, 2026
17 checks passed
ericksoa added a commit that referenced this pull request Apr 21, 2026
## Summary
- The `telegram.yaml` preset was missing `tls: terminate` on the
`api.telegram.org` endpoint
- The baseline `openclaw-sandbox.yaml` has it, but the preset omitted it
- After PR #2098 changed gateway TLS field handling, the omission causes
403 on live policy-add (TC-NET-03)

## Test plan
- [ ] Nightly E2E `network-policy-e2e` job passes (TC-NET-03)

Fixes regression from #2098.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Chores**
* Telegram network preset now uses TLS termination for connections to
api.telegram.org:443, changing TLS handling for that endpoint.
* **Tests**
* Test suite updated to reflect TLS behavior: gateway/WebSocket presets
assert TLS is skipped, and Telegram preset asserts TLS termination for
REST endpoints.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
ericksoa pushed a commit that referenced this pull request Apr 24, 2026
## Summary

Add `tls: skip` to all six endpoints in the `brew` policy preset so the
L7 proxy performs L4 pass-through instead of TLS termination.

## Problem

After OpenShell v0.0.15+ began auto-terminating TLS on every detected
TLS stream
([OpenShell#544](NVIDIA/OpenShell#544)), `git`
inside the sandbox fails with:

```
fatal: unable to access 'https://github.com/Homebrew/brew.git/':
server certificate verification failed. CAfile: none CRLfile: none
```

`curl` to the same host through the same proxy succeeds, and `git -c
http.sslVerify=false` also succeeds — isolating the defect to the
proxy's TLS termination presenting a certificate that git's OpenSSL
cannot validate.

## Fix

Add `tls: skip` to all brew preset endpoints (`formulae.brew.sh`,
`github.com`, `ghcr.io`, `pkg-containers.githubusercontent.com`,
`objects.githubusercontent.com`, `raw.githubusercontent.com`). This
restores L4 pass-through so git validates the real server certificates
directly.

This follows the same pattern established in PR #2098 for Discord/Slack
WebSocket endpoints.

## Test plan

- [x] `npx vitest run test/policies.test.ts` — 86 tests pass
- [ ] Nightly E2E: `brew` preset `git ls-remote` against whitelisted
endpoint succeeds without `http.sslVerify=false`

Fixes #2331

Signed-off-by: kagura-agent <kagura-agent@users.noreply.github.com>

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Chores**
* Updated network policy presets to modify TLS certificate verification
behavior for connections to multiple package repository and external
service endpoints supporting package management operations.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Signed-off-by: kagura-agent <kagura-agent@users.noreply.github.com>
Signed-off-by: kagura-agent <kagura.agent.ai@gmail.com>
DemianHeyGen pushed a commit to DemianHeyGen/NemoClaw that referenced this pull request Apr 30, 2026
…IDIA#2338)

## Summary

Add `tls: skip` to all six endpoints in the `brew` policy preset so the
L7 proxy performs L4 pass-through instead of TLS termination.

## Problem

After OpenShell v0.0.15+ began auto-terminating TLS on every detected
TLS stream
([OpenShell#544](NVIDIA/OpenShell#544)), `git`
inside the sandbox fails with:

```
fatal: unable to access 'https://github.com/Homebrew/brew.git/':
server certificate verification failed. CAfile: none CRLfile: none
```

`curl` to the same host through the same proxy succeeds, and `git -c
http.sslVerify=false` also succeeds — isolating the defect to the
proxy's TLS termination presenting a certificate that git's OpenSSL
cannot validate.

## Fix

Add `tls: skip` to all brew preset endpoints (`formulae.brew.sh`,
`github.com`, `ghcr.io`, `pkg-containers.githubusercontent.com`,
`objects.githubusercontent.com`, `raw.githubusercontent.com`). This
restores L4 pass-through so git validates the real server certificates
directly.

This follows the same pattern established in PR NVIDIA#2098 for Discord/Slack
WebSocket endpoints.

## Test plan

- [x] `npx vitest run test/policies.test.ts` — 86 tests pass
- [ ] Nightly E2E: `brew` preset `git ls-remote` against whitelisted
endpoint succeeds without `http.sslVerify=false`

Fixes NVIDIA#2331

Signed-off-by: kagura-agent <kagura-agent@users.noreply.github.com>

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Chores**
* Updated network policy presets to modify TLS certificate verification
behavior for connections to multiple package repository and external
service endpoints supporting package management operations.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Signed-off-by: kagura-agent <kagura-agent@users.noreply.github.com>
Signed-off-by: kagura-agent <kagura.agent.ai@gmail.com>
@wscurran wscurran added area: policy Network policy, egress rules, presets, or sandbox policy bug-fix PR fixes a bug or regression feature PR adds or expands user-visible functionality and removed fix feature PR adds or expands user-visible functionality labels Jun 3, 2026
@wscurran wscurran added NV QA Bugs found by the NVIDIA QA Team UAT Issues flagged for User Acceptance Testing. labels Jun 26, 2026
@cv
cv deleted the fix/2092-websocket-tls-skip branch June 28, 2026 00:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: policy Network policy, egress rules, presets, or sandbox policy bug-fix PR fixes a bug or regression NV QA Bugs found by the NVIDIA QA Team UAT Issues flagged for User Acceptance Testing.

Projects

None yet

3 participants