我试图在防火墙后安装cabal但没有成功。 似乎cabal不支持http重定向, 有没有办法解决它?
cabal update -v3
Downloading the latest package list from hackage.haskell.org Sending: GET http://hackage.haskell.org/packages/archive/00-index.tar.gz HTTP/1.1 User-Agent: cabal-install/1.20.0.2 (linux; x86_64) Host: hackage.haskell.org proxy uri host: proxy.swmed.edu, port: :3128 Creating new connection to proxy.swmed.edu:3128 Received: HTTP/1.1 302 authenticationrequired Via: 1.1 129.112.115.40 (McAfee Web Gateway 7.4.2.1.0.17593) Date: Fri, 20 Jun 2014 17:00:56 GMT Location: https://m-proxy1.swmed.edu:10000/mwg-internal/de5fs23hu73ds/plugin?target=Auth&reason=Auth&ClientID=2152648114&ttl=43200&url=aHR0cDovL2hhY2thZ2UuaGFza2VsbC5vcmcvcGFja2FnZXMvYXJjaGl2ZS8wMC1pbmRleC50YXIuZ3o=&rnd=1403283656 Content-Type: text/html Cache-Control: no-cache Content-Length: 3678 Proxy-Connection: Keep-Alive 302 - redirect Warning: http error: Unable to handle redirect, unsupported scheme: https://m-proxy1.swmed.edu:10000/mwg-internal/de5fs23hu73ds/plugin?target=Auth&reason=Auth&ClientID=2152648114&ttl=43200&url=aHR0cDovL2hhY2thZ2UuaGFza2VsbC5vcmcvcGFja2FnZXMvYXJjaGl2ZS8wMC1pbmRleC50YXIuZ3o=&rnd=1403283656 cabal: Failed to download http://hackage.haskell.org/packages/archive/00-index.tar.gz : ErrorMisc "Error HTTP code: 302"
(更新)2014年6月23日
按照@Sibi建议,我使用cntlm-0.92.3
粘贴了类似的体验。
这是我的配置config.ini
:
Proxy proxy.swmed.edu:3128 Listen 127.0.0.1:53124
我首先尝试使用:
./cntlm -c config.ini
然后发生同样的错误:
cabal update -v3 Downloading the latest package list from hackage.haskell.org Sending: GET http://hackage.haskell.org/packages/archive/00-index.tar.gz HTTP/1.1 User-Agent: cabal-install/1.20.0.2 (linux; x86_64) Host: hackage.haskell.org proxy uri host: 127.0.0.1, port: :53124 Creating new connection to 127.0.0.1:53124 Received: HTTP/1.1 302 authenticationrequired Via: 1.1 129.112.115.43 (McAfee Web Gateway 7.4.2.1.0.17593) Date: Mon, 23 Jun 2014 05:34:18 GMT Location: https://m-proxy4.swmed.edu:10000/mwg-internal/de5fs23hu73ds/plugin?target=Auth&reason=Auth&ClientID=1513153200&ttl=43200&url=aHR0cDovL2hhY2thZ2UuaGFza2VsbC5vcmcvcGFja2FnZXMvYXJjaGl2ZS8wMC1pbmRleC50YXIuZ3o=&rnd=1403501658 Content-Type: text/html Cache-Control: no-cache Content-Length: 3678 Proxy-Connection: Keep-Alive Connection: close 302 - redirect Warning: http error: Unable to handle redirect, unsupported scheme: https://m-proxy4.swmed.edu:10000/mwg-internal/de5fs23hu73ds/plugin?target=Auth&reason=Auth&ClientID=1513153200&ttl=43200&url=aHR0cDovL2hhY2thZ2UuaGFza2VsbC5vcmcvcGFja2FnZXMvYXJjaGl2ZS8wMC1pbmRleC50YXIuZ3o=&rnd=1403501658 cabal: Failed to download http://hackage.haskell.org/packages/archive/00-index.tar.gz : ErrorMisc "Error HTTP code: 302"
注意:此问题与身份验证不同,因为我们的代理服务器不需要进行身份验证。这个问题是关于http重定向问题。
(更新)2014年6月23日
运行以下命令@Sibi建议:
./cntlm -M http://www.google.com -c config.ini -v
找到
答案 0 :(得分:0)
阅读日志,我们看到代理是通过https
而不是http
,错误是"不支持的方案"因为最近版本之前的cabal没有处理https。在最新版本中,Https传输已添加到cabal中,因此现在应该解决该问题。