git curl:(35) 服务器在 Mac OS X El Capitan (10.11.4) 中中止 SSL 握手

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/39179561/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 12:13:04  来源:igfitidea点击:

curl: (35) Server aborted the SSL handshake in Mac OS X El Capitan (10.11.4)

gitmacossslbitbucket

提问by aka_007

When I run this command:

当我运行此命令时:

git clone <bitbucket repo>.git

I get the error:

我收到错误:

fatal: unable to access '.git/': Server aborted the SSL handshake

致命:无法访问“.git/”:服务器中止 SSL 握手

When I run the command:

当我运行命令时:

git --version

Output:

输出:

git version 2.9.2

版本 2.9.2

I am unable to understand if the problem is with the gitinstalled in my Mac or with my Mac.

我无法理解问题是出在 Mac 上安装的git 上还是出在我的 Mac 上。

回答by aka_007

Got it. This was because I was behind a proxy and this wasn't set as environment variable in command line (thought it was set in System Preferences -> Network -> LAN)

知道了。这是因为我在代理后面,并且没有在命令行中将其设置为环境变量(认为它是在系统偏好设置 -> 网络 -> LAN 中设置的)

Add these 2 lines in ~/.bashrcfile if you are behind a proxy:

如果您在代理后面,请在~/.bashrc文件中添加这两行:

export http_proxy=http://<proxy_url>:<proxy_port>/
export https_proxy=https://<proxy_url>:<proxy_port>/