git 代理背后的企业 Github:在 CONNECT 后从代理收到 HTTP 代码 503

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

Corporate Github behind proxy: Received HTTP code 503 from proxy after CONNECT

gitgithubproxygit-configcorporate

提问by ben0it8

I am trying to clone from a corporate git repo, but always receive this error message after a while:

我正在尝试从公司 git repo 克隆,但一段时间后总是收到此错误消息:

fatal: unable to access URL: Received HTTP code 503 from proxy after CONNECT

致命:无法访问 URL:在 CONNECT 后从代理收到 HTTP 代码 503

I have the following .gitconfig file:

我有以下 .gitconfig 文件:

[https]
    sslVerify = false
    proxy = https://proxy.corpadderess:8080
[http]
    sslVerify = false
    proxy = http://proxy.corpadderess:8080  

回答by srctaha

If it is a corporate repo, you might want to ignore proxy settings. One possible solution to your problem is here:

如果它是企业存储库,您可能希望忽略代理设置。您的问题的一种可能解决方案是:

  1. Ignore proxy: export no_proxy=YOUR_CORP_DOMAIN_ON_GITHUB, where the domain name might be in the form of github.acme.net

  2. Ignore SSL verification: git config --global http.sslVerify "false"

  1. Ignore proxy: export no_proxy=YOUR_CORP_DOMAIN_ON_GITHUB,其中域名的形式可能是github.acme.net

  2. 忽略 SSL 验证: git config --global http.sslVerify "false"

You could then clone the repo w/ git clone YOUR_HTTPS_CLONE_URL

然后你可以克隆 repo w/ git clone YOUR_HTTPS_CLONE_URL

回答by EM-Creations

In my case I needed to disable both the proxy and authenticating SSL certificates, I don't really like this solution as it doesn't sit well with me - turning off verifying SSL certificates doesn't sound wise!

在我的情况下,我需要禁用代理和验证 SSL 证书,我真的不喜欢这个解决方案,因为它不适合我 - 关闭验证 SSL 证书听起来不明智!

But here's the command I ran to get it to work:

但这是我为了让它工作而运行的命令:

git clone <addr of repo> --config http.proxy= --config http.sslVerify=false

回答by Sadegh Soleimanpour

If you want to ignore proxy for a single git command you can use -c option, for example:

如果您想忽略单个 git 命令的代理,您可以使用 -c 选项,例如:

git clone http://[email protected]/repo.git--config http.proxy=

git clone http://[email protected]/repo.git--config http.proxy=

回答by foxyzorro

you can add in your .gitconfig file for ignore your corporate proxy :

您可以添加 .gitconfig 文件以忽略您的公司代理:

[http "http://proxy.corpadderess:8080"]
    sslVerify = false
    proxy =     

回答by Delphine

I faced the same issue and don't want to bypass SSL verification.

我遇到了同样的问题,不想绕过 SSL 验证。

I make it work thanks to these steps (Windows):

由于这些步骤(Windows),我使它工作:

1. Launch in a console :

1. 在控制台中启动:

C:\Users\ME>nslookup gitlab.my-company.fr
Serveur :   ken45d45.ntkd0.my-company.fr
Address:  XXXX.XXXX.XXXX.XXXX

Réponse ne faisant pas autorité :
Nom :    zep150y1fv0.something-else-company.fr
Address:  XXXX.XXXX.XXXX.XXXX
Aliases:  gitlab.my-company.fr

2. In order to clone [email protected]:project/group/sources.git :

2. 为了克隆 [email protected]:project/group/sources.git :

Replace by the original instead of alias :

替换为原始而不是 alias :

git clone [email protected]:project/group/sources.git

回答by Xavier NICOLZA

If the repository is on GitLab, you must be a member of the Group or of the project ( see https://git-scm.com/book/en/v2/Git-on-the-Server-GitLab).

如果存储库在 GitLab 上,您必须是组或项目的成员(请参阅https://git-scm.com/book/en/v2/Git-on-the-Server-GitLab)。