git SSL_connect: SSL_ERROR_SYSCALL 连接到 github.com:443
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/48987512/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443
提问by Emile Cantero
Since a few days I got an issue with Mac OS High Sierra 10.13.3 :
When I run a git clone
like git clone github.com/xxx.git failed
it print:
几天以来,我遇到了 Mac OS High Sierra 10.13.3 的问题:当我运行git clone
类似的git clone github.com/xxx.git failed
打印时:
LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443
LibreSSL SSL_connect: SSL_ERROR_SYSCALL 连接到 github.com:443
Same issue with npm i
command
Even when I try to install brew like so:
npm i
命令也有同样的问题即使我尝试像这样安装 brew:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
I also tried the alternative setup: same.
我也尝试了替代设置:相同。
回答by mljrg
I had this similar error when using wget ...
, and after much unfruitful searching in the Internet, I discovered that it was happening when hostnames were being resolved to IPv6 addresses. I discovered this by comparing the outputs of wget ...
in two machines, one was resolving to IPv4 and it worked there, the other was resolving to IPv6 and it failed there.
我在使用 时遇到了类似的错误wget ...
,在 Internet 上进行了很多徒劳的搜索后,我发现它发生在将主机名解析为 IPv6 地址时。我通过比较wget ...
两台机器的输出发现了这一点,一台解析为 IPv4 并在那里工作,另一台解析为 IPv6 并在那里失败。
So the solution in my case was to run networksetup -setv6off Wi-Fi
on macOS High Sierra 10.13.6. (I discovered this command in this page).
所以我的解决方案是networksetup -setv6off Wi-Fi
在 macOS High Sierra 10.13.6 上运行。(我在这个页面中发现了这个命令)。
Hope this helps you.
希望这对你有帮助。
回答by Nick Zhang
Same problem here, it turned out to be my incorrectly configured proxy settings, here's how to check and remove them.
同样的问题,原来是我配置错误的代理设置,这里是如何检查和删除它们。
First open your git config file.
首先打开你的 git 配置文件。
vi ~/.gitconfig
and find out whether the [http]
or [https]
sections are set.
并找出是否设置了[http]
或[https]
部分。
I used to set proxies for git due to slow access to Github in China, however, lately I changed my local proxy ports but I forgot my git settings.
由于在 CN 访问 Github 速度慢,我曾经为 git 设置代理,但是,最近我更改了本地代理端口,但忘记了我的 git 设置。
If you have incorrect proxy settings and decide to remove it, simply execute:
如果您的代理设置不正确并决定将其删除,只需执行:
git config --global --unset http.proxy
git config --global --unset https.proxy
Things will work just fine.
事情会很好。
回答by Raul
A simple restart fixed it for me. I'm not sure what was the problem since I work with so much software but I have a feeling it was the VPN software or maybe the fact I put my laptop in sleep a lot and some file was corrupted. I really don't know but the restart fixed it.
一个简单的重启为我修复了它。我不确定是什么问题,因为我使用了这么多软件,但我感觉是 VPN 软件,或者我的笔记本电脑经常处于睡眠状态并且某些文件已损坏。我真的不知道,但重启修复了它。
回答by Sergey Kuznetsov
I have a similar issue and I just found that in my case it may be the antivirus that creates an issue.
我有一个类似的问题,我刚刚发现在我的情况下可能是防病毒软件造成了问题。
At some moment I've got the same error while trying to pull some data from github.com.
有时我在尝试从 github.com 中提取一些数据时遇到了同样的错误。
I knew that Kaspersky is intercepting the SSL connections to check for malicious content from the sites and I decided to disable it, but I found that KAV is hung and not really responding, so I just closed Kaspersky and tried to connect to github.com again and alas! I was able to connect successfully to GitHub.
我知道卡巴斯基正在拦截 SSL 连接以检查来自站点的恶意内容,我决定禁用它,但我发现 KAV 挂起并且没有真正响应,所以我只是关闭了卡巴斯基并尝试再次连接到 github.com唉!我能够成功连接到 GitHub。
So in you case it may be a similar issue.
所以在你的情况下,它可能是一个类似的问题。
回答by Phil Wilson
From https://github.com/Homebrew/brew/issues/4436#issuecomment-403194892
来自https://github.com/Homebrew/brew/issues/4436#issuecomment-403194892
Issue solved by setting this env variable:
通过设置此环境变量解决的问题:
export HOMEBREW_FORCE_BREWED_CURL=1
回答by dingo
1) Tried creating a new branch and pushing. Worked for a couple of times but faced the same error again.
1)尝试创建一个新分支并推送。工作了几次,但再次面临同样的错误。
2)Just ran these two statements before pushing the code. All I did was to cancel the proxy.
2)在推送代码之前运行这两个语句。我所做的就是取消代理。
$ git config --global --unset http.proxy
$ git config --global --unset https.proxy
3) Faced the issue again after couple of weeks. I have updated homebrew and it got fixed
3)几周后再次面对这个问题。我已经更新了自制软件,它得到了修复
回答by joliejuly
I just turned off VPN and it solved the issue.
我刚刚关闭了 VPN,它解决了问题。
回答by Julien
same issue with KAV. Restart it solved the pb.
与 KAV 相同的问题。重启它解决了pb。
回答by kenorb
Since you're using LibreSSL
, try re-installing curl
with OpenSSL
instead of Secure Transport.
由于您使用LibreSSL
,尝试重新安装curl
以OpenSSL
代替安全传输。
Latest Brew
最新酿造
All options have been removed from the curl
formula, so now you need to install via:
所有选项都已从curl
公式中删除,因此现在您需要通过以下方式安装:
brew install curl-openssl
Older Brew
老啤酒
Install curl
with --with-openssl
:
安装curl
有--with-openssl
:
brew reinstall curl --with-openssl
Note: If above won't work, check brew options curl
to display install options specific to formula.
注意:如果以上方法不起作用,请检查brew options curl
以显示特定于公式的安装选项。
Here are few other suggestions:
以下是一些其他建议:
- Make sure you're not using
http_proxy
/https_proxy
. - Use
-v
tocurl
for more verbose output. - Try using BSD
curl
at/usr/bin/curl
, runwhich -a curl
to list them all. - Make sure you haven't accidentally blocked
curl
in your firewall (such as Little Snitch). - Alternatively use
wget
.
- 确保您没有使用
http_proxy
/https_proxy
。 - 使用
-v
到curl
更详细的输出。 - 尝试
curl
在 处使用 BSD/usr/bin/curl
,运行which -a curl
以列出它们。 - 确保您没有意外阻止
curl
防火墙(例如Little Snitch)。 - 或者使用
wget
.
回答by Andreas GS
I would suggest updating git. If you downloaded the .pkg
then be sure to uninstall it first.
我建议更新git。如果您下载了,请.pkg
务必先卸载它。