-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Closed
Labels
bugSomething isn't workingSomething isn't workinggh-authrelating to the gh auth commandrelating to the gh auth commandp2Affects more than a few users but doesn't prevent core functionsAffects more than a few users but doesn't prevent core functions
Description
Describe the bug
gh has an option "http_unix_socket" that should route HTTP requests through the provided unix domain socket. In some places, that option is ignored where it should be used.
Fix PR
I sent you a PR with an attempted fix in #11890
Affected version
2.80.0
Steps to reproduce the behavior
Run gh auth login with the http_unix_socket option set, and watch it be ignored for outgoing HTTP requests.
Expected vs actual behavior
Device flow authentication should be possible when using http_unix_socket. gh should not bypass the socket and make HTTP requests directly (should not bypass the proxy).
Logs
Paste the activity from your command line. Redact if needed.
$ GH_CONFIG_DIR=$HOME/gh_config gh config list
...redacted...
http_unix_socket=/<redacted>/ggh-1760032788919400188.sock
$ GH_CONFIG_DIR=$HOME/gh_config GH_DEBUG=api gh auth login -h <redacted>
? What is your preferred protocol for Git operations on this host? HTTPS
[git config credential.https://<redacted>]
[git config credential.helper]
? Authenticate Git with your GitHub credentials? No
? How would you like to authenticate GitHub CLI? Login with a web browser
<at this point the gh CLI starts talking directly to the GHES server when it should use the http_unix_socket>
* Request at 2025-10-09 12:15:39.622283804 -0700 PDT m=+5.062799595
* Request to https://<redacted>/login/device/code
> POST /login/device/code HTTP/1.1
> Host: <redacted>
> Content-Length: 57
> Content-Type: application/x-www-form-urlencoded
...redacted...
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinggh-authrelating to the gh auth commandrelating to the gh auth commandp2Affects more than a few users but doesn't prevent core functionsAffects more than a few users but doesn't prevent core functions