cli: Post https://api.github.com/graphql: net/http: TLS handshake timeout
Describe the bug
TLS handshake timeout error upon first ever run of gh issue list
after having the CLI installed.
gh version 0.5.5 (2020-02-13)
https://github.com/cli/cli/releases/tag/v0.5.5
Steps to reproduce the behavior
brew install github/gh/gh
gh issue list
- Authenticate via the URL provided.
- Authentication complete. Press Enter to continue…
- Retry
gh issue list
- Observe the error after ~10 seconds:
Post https://api.github.com/graphql: net/http: TLS handshake timeout
Expected vs actual behavior
I was expecting to see the list of issues for the current working directory’s repo, however it ended up error-ing on me.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 43 (15 by maintainers)
@mislav I have the same problem, it could be a proxy settings problem. I have set it in Git config. If possible make Github CLI to read the Git configuration by default. Personally, I do not want set global system proxy.
Thank you all for your patience! We just released a new version using Go 1.15 that ships a fix for the “TLS handshake timeout” that some macOS users have been experiencing: https://github.com/cli/cli/releases/tag/v0.12.0
@hantsy no need to set proxy in git config, a proxy() and a noproxy() function in your bash_rc or bash_profile would be easier if you’re a developer in china. most cli(eg. git,curl,wget,go,brew …) respects http_proxy, https_proxy, HTTP_PROXY, HTTPS_PROXY.
Yeah,I am sure it is a general problem in China. If there are some issues to read git config, I think it is accepted to add the proxy config support to the
gh config
command. (or provide an option ingh config
to users to decide if read git config )The author of the patch is collecting feedback from macOS people affected. All you have to do (takes about a minute) is to run these steps:
For me this listed custom certificates from my Keychain and passed the test, but I was never affected by this issue either.
@exalted omg, turns out this was known to golang and seems to have been patched yesterday! https://github.com/golang/go/issues/19561#issuecomment-390786867
@exalted Thank you for trying! I’m puzzled about the 20 second-ish timeout when that build has a setting of 60s for TLS handshake timeout 😕 I would have expected that the command would block for at least 60s before it gives up. This is just more evidence that this isn’t network-related at all.
I get the timeout still from the 0.8.0-pre.0 build.
@exalted @ggilley Do you have
https_proxy
orno_proxy
set in your environment?I am yet to make it work once, so I’ve been pretty unlucky so far I guess…
Here’s the output of
DEBUG=api gh issue list
when I am inside the clone working directory of my personal dot files repository (https://github.com/exalted/dotfiles):Here’s the output of
git remote -v
, if helps: