git 在 CONNECT 后从代理返回 http 错误 407 [英] git returns http error 407 from proxy after CONNECT

查看:69
本文介绍了git 在 CONNECT 后从代理返回 http 错误 407的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用 git 从我的 PC 连接到 github 时遇到问题.系统Win 7.

I have a problem while connecting to github from my PC, using git. System Win 7.

我通过代理建立连接,所以我在 git 配置文件中指定了它(在一般 git 文件夹和 git repo 文件夹中).为此,我在 git Bush 的下一行输入:

I have connection through proxy, so i specified it in git config files (both in general git folder, and in git repo folder). To do this i entered next line to my git bush:

$ git config --global http.proxy http://<username>:<userpsw>@<proxy>:<port>

它在其他程序(例如:maven)上的工作方式是这样的:

The way it works on other programms (ex: maven) it looks like that:

<username> - my login to our corp system
<userpsw> -my password to corporat system
<proxy> - 10.65.64.77
<port> - 3128

但是当我尝试推送或克隆我的仓库时,我收到

But when i try to push or to clone my repo, i receive

fatal: unable to access '<repo githup link>' Received HTTP code 407 from proxy after CONNECT

我已经尝试不仅输入我的用户名,还输入域用户名,更改密码以防代码语言表出现问题.我什至输入了错误的密码.错误保持不变.

I try already to enter not just my username but domainusername, changed my password in case there are problems with code language tables. And i even entered wrong password. Error stayed the same.

当我进入10.65.64.177.com"并尝试推送回购时,我收到:

When i entered in '10.65.64.177.com' and tried to push repo, i received:

fatal: unable to access '<repo github link>': Failed connect to github.com:3128; No error

就是不知道该尝试什么.

Just don't know what to try.

推荐答案

对我有用的是类似于 rohitmohta 提出的方案;在常规 DOS 命令提示符下(不在 git bash 上):

What worked for me is something similar to what rohitmohta is proposing ; in regular DOS command prompt (not on git bash) :

第一次

git config --global http.proxy http://username:password@proxiURL:proxiPort

在某些情况下也是

git config --global https.proxy http://username:password@proxiURL:proxiPort

然后

git config --global http.sslVerify false

(我确认这是必要的:如果设置为 true,则会出现SSL 证书问题:无法获取本地颁发者证书"错误)

(I confirm it's necessary : if set to true getting "SSL certificate problem: unable to get local issuer certificate" error)

就我而言,不需要定义 all_proxy 变量

in my case, no need of defining all_proxy variable

最后

git clone https://github.com/someUser/someRepo.git

这篇关于git 在 CONNECT 后从代理返回 http 错误 407的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆