【问题标题】:Git Bash on windows 7 behind proxy no longer working代理后面的 Windows 7 上的 Git Bash 不再工作
【发布时间】:2013-08-19 18:36:58
【问题描述】:

我使用的是 Windows 7 32 位机器,并且在代理后面工作。我刚刚将我的 git 客户端 (Git Bash) 升级到 Git-1.8.3-preview20130601,突然间,每当我尝试推/拉时,我都会收到以下错误:

fatal: unable to access 'https://github.com/User/simple_timesheets.git/: 
Received HTTP code 407 from proxy after Connect

在升级之前我能够做到这一点,即使我尝试恢复到我认为我拥有的上一个版本,我仍然会收到错误消息。当我运行git config -l 时,它会列出以下变量(以及其他变量):

user.name=MyName
user.email=My@email.com
http.proxy=http://user:password@server:port
core.autocrlf=true
https.proxy=http://user:password@server:port
http.sslcainfo=/bin/curl-ca-bundle.crt

奇怪的是我似乎可以使用Git Bash 客户端卷曲就好了

curl finance.yahoo.com --proxy http://user:password@server:port

甚至可以卷曲到我在计算机上设置的虚拟 https 站点:

curl https://localhost:3000 --insecure

任何想法我错过了什么?谢谢


编辑:

我可能是错的,但我认为版本 1.8.3 中的 curl 可能存在问题。我在我的电脑上卸载了所有我能想到的与 git 相关的应用程序,并安装了Git-1.8.0-preview20121022,运行了一个 repo 并成功了。

为了傻笑,我卸载了工作版本,并保留了证书文件;然后重新安装了 1.8.3 版本,看看这是否与它没有任何关系,但我遇到了与我最初试图解决的相同的错误。

另外,在重新安装 1.8.0 版本后,我尝试使用以下命令 curl 一个 https 网站(gmail):curl https://www.gmail.com --proxy http://user:pass@server:port,成功。当我在 1.8.3 下执行此操作时,我收到有关代码 407 的错误。版本切换似乎解决了这个问题。

【问题讨论】:

  • 我刚刚尝试运行以下命令:curl https://www.gmail.com --proxy http://user:password@server:port > gmail.html,它给出了以下命令:curl: (56) Received HTTP code 407 from proxy after CONNECT
  • stackoverflow.com/questions/8561671 的重复项?有关 https 代理,请参阅我的 answer there

标签: windows git github


【解决方案1】:

我使用两个代理过滤器解决了同样的问题:

“--proxy or -x”和“--proxy-user”。

curl -x http://proxyserverurl:port --proxy-user username:password -L http://url

虽然你尝试过的也没有错,但可能与你的 curl 版本不兼容。

希望这会有所帮助!

【讨论】:

    【解决方案2】:

    我有同样的问题。导出环境变量https_proxyhttp_proxy 解决了这个问题。所以我最终将以下几行添加到主目录中的.bashrc 文件中:

    # Configure proxy settings
    export https_proxy='http://myproxy.example.com:8086/' 
    export http_proxy='http://myproxy.example.com:8086/' 
    

    【讨论】:

      猜你喜欢
      • 2011-07-03
      • 1970-01-01
      • 2012-08-01
      • 1970-01-01
      • 1970-01-01
      • 2017-12-08
      • 2018-09-27
      • 2022-07-05
      • 2019-03-31
      相关资源
      最近更新 更多