Skip to content

feat(ssh): route GitHub SSH over port 443 - #1

Open
perezdap wants to merge 1 commit into
mainfrom
feat/github-ssh-over-443
Open

feat(ssh): route GitHub SSH over port 443#1
perezdap wants to merge 1 commit into
mainfrom
feat/github-ssh-over-443

Conversation

@perezdap

Copy link
Copy Markdown
Owner

What

Adds an opt-out (Y/n, default yes) step to the identity setup that writes a Host github.comssh.github.com:443 block to ~/.ssh/config.

Why

On some networks (corporate firewalls, ISPs, VPNs) outbound SSH on port 22 is intermittently blocked, throttled, or reset — surfacing as random Connection timed out / Connection reset on git fetch/push, while HTTPS (443) stays reliable. GitHub officially supports SSH over its ssh.github.com:443 endpoint, and routing through it sidesteps the problem without changing remotes or keys.

Changes

  • setup.ps1 — new Set-GitHubSSHOverHttps helper + auto-run prompt in Set-GitIdentity.
  • setup.sh — mirrored configure_github_ssh_over_https helper + prompt in configure_identity.
  • Tests: tests/Test-GitHubSSHOverHttps.ps1 and tests/test_github_ssh_over_https.sh (content-verification, matching existing style).

Safety

  • Idempotent — skips if a Host github.com block already exists in ~/.ssh/config, so re-runs never duplicate or clobber.
  • Composes with the existing core.sshCommand -i <key> setup: key selection and host/port rewrite are orthogonal.

Verification

  • New + existing tests pass in both shells.
  • setup.ps1 parses clean; setup.sh passes bash -n.
  • Bash helper idempotency confirmed in a temp HOME: appends once, skips on re-run, exactly one Host github.com block.

Add an opt-out (Y/n, default yes) step to the identity setup that writes a
'Host github.com -> ssh.github.com:443' block to ~/.ssh/config, working around
networks that intermittently block or reset outbound SSH on port 22.

Idempotent: skips if a 'Host github.com' block already exists. Mirrored across
setup.ps1 and setup.sh with matching content-verification tests.
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