Skip to content

fix(macOS): authenticate Git SSH SOCKS proxy connections - #482

Open
Kaylebor wants to merge 1 commit into
anthropics:mainfrom
Kaylebor:upstream-macos-git-ssh-socks-auth
Open

fix(macOS): authenticate Git SSH SOCKS proxy connections#482
Kaylebor wants to merge 1 commit into
anthropics:mainfrom
Kaylebor:upstream-macos-git-ssh-socks-auth

Conversation

@Kaylebor

Copy link
Copy Markdown

Summary

macOS's bundled BSD nc supports SOCKS5 but cannot perform username/password authentication. When the sandbox proxy requires its per-session credential, Git SSH fails during SOCKS method negotiation before reaching the repository.

This adds a small Node-based ProxyCommand client that is selected only on macOS when proxyAuthToken is present. It performs the standard SOCKS5 username/password handshake, connects to the requested SSH destination, and pipes the SSH stream through. Unauthenticated macOS configurations retain the existing BSD nc command, and Linux behavior is unchanged.

The SOCKS server is intentionally untouched. This keeps the change on the client side and avoids the broader server rewrite and hardening scope in #385, which provided the relevant inspiration for the authentication problem.

Testing

  • npm run typecheck
  • npm run build
  • npm run lint:check
  • bun test test/sandbox/proxy-env-vars.test.ts test/sandbox/socks-authenticated-client.test.ts
  • Live macOS sandbox exercise reached GitHub through the authenticated proxy; the remaining failure was the expected SSH key authorization response rather than proxy authentication.

@Kaylebor

Copy link
Copy Markdown
Author

Reasoning/testing: I've been playing with copying Codex's auto-review flow on Pi (more or less), here https://github.com/Kaylebor/pi-permission-reviewer

Heavily vibe-coded though, not really tested on serious work yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant